Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
lucaL
Partner - Contributor II
Partner - Contributor II

ELT merge and target operations

Hi all,

We are developing an ELT process using oracle merge, where a column to be updated needs to have as the new value the greatest between the new value and the target current value.

In sql it would be something like:

MERGE INTO myTable target USING (
SELECT a, b FROM newTable) Source
ON (target.a = source.a)
WHEN MATCHED THEN UPDATE SET
target.b = greatest(source.b, target.b)
WHEN NOT MATCHED THEN INSERT
(target.a, target.b)
VALUES (source.a, source.b)
 
Any way to make the same using the tELTOracleOutput? 🤔 
 
Thanks!
Labels (2)
2 Replies
Dave_Simo
Creator II
Creator II

Hello @lucaL 

From my experience, I don't think you can perform both operations (insert, update) simultaneously in a tELTOracleOutput.

But you can do it with a tSQLTemplateMerge. You can use this component's configuration as a guide, as shown below :

Dave_Simo_0-1755006148202.png

 

Source : https://help.qlik.com/talend/fr-FR/components/8.0/sqltemplate/tsqltemplatemerge-tsqltemplatecommit-t...

Best Regards

lucaL
Partner - Contributor II
Partner - Contributor II
Author

Hi,

thanks for the repoly. This works almost as the TELTOracleOutput whene you choose the merge operation. The problem is still the same, I think, you cannot use the target table values on the update statement, since talend use just the "target.column = source.column" logic... It seems there is no way to define a different logic, as would be "target.colum = target.column + source.column"... Isn't it?

Regards 🙂