How do i write different queries based on different conditions within db2 stage? i have a column based on which i need to write 3 insert queries and 1 update query is it possible without using multiple db2 stages or transformer?????
Depending upon the conditions, build your insert/update logic and load it to a file (.sql). Then execute the .sql file from command line which you can do in after job subroutine using ExecSh.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Well, In a table there is a row with a flag and expiry timestamp column. which, I would want to expire by updating the flag to N and current timestamp to the expiry date column and then insert a new row with an active flag. to achieve this i tried upsert but it is inserting the row but not updating the previous row. do you know why????
Well, I have written both the queries in DB2 UDB stage with upsert option selected but that doesnt work. Does that mean that in upsert either insert or update works and never both together. Incase, if i want to do it within the same DB2 UDB stage how am i going to do that???