Page 1 of 1

OdbcOutput Update and Insert

Posted: Thu Aug 04, 2022 5:15 pm
by mnasra
Hi Expert,

I know how to write the sql for odbcoutput Insert (if I truncated the table).
I know also how to write the Update, if I dont want to truncate the table.

My problem, is that the second one (which I want to use, because I dont want to truncate the table) does not do the inserts for new records.
The TI does not even give me an error when a new record is found in tm1.

what is the way to do both in the TI process.
thanks

Re: OdbcOutput Update and Insert

Posted: Thu Aug 04, 2022 10:03 pm
by declanr
Hi,

There will be many different ways to do this and it is partially dependent on the DB you are using (e.g. Oracle, SQL Server etc.)
That being said, generally, in cases like this, I would do a straight Insert/Bulk Update to a temp table in the DB and then use a MERGE to transfer data from the temp table into the actual target table.

Thanks,
Declan

Re: OdbcOutput Update and Insert

Posted: Thu Aug 04, 2022 10:14 pm
by mnasra
It is a SQL Server table.
And yes, it is exactly what usually we do. I appreciate the answer, because the more techy than me are giving all sorts of SQL commands, and none is working.

Thank you for your help, I will stop looking and do exactly what you said.