Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello world !
I'm using a tOracleOutput set on Update or Insert.
I would like to know if a row is actually inserted into the database, or if it updates.
I've thought about a solution : check first if this row is in the targeted table making an inner join and getting rejected = this row will be inserted, else it's an update.
However, I would like to know there is a built-in method to know that ?
Thanks in advance ! 🙂
Hi,
I am exploring TOS since a week...
Hope this code helps...
[1] Put below code in tJava component code:
System.out.println("Inserts: " + ((Integer)globalMap.get("tDBOutput_1_NB_LINE_INSERTED")));
System.out.println("Updates: " + ((Integer)globalMap.get("tDBOutput_1_NB_LINE_UPDATED")));
System.out.println("Deletes: " + ((Integer)globalMap.get("tDBOutput_1_NB_LINE_DELETED")));
[2] DBOutput (Trigger) On Component Ok - Link to tJava_1 component
Thanks for the quick response, it's super helpful.
But if I want to have this output format (with data from my columns):
INSERT: id1, XXX, XXX
INSERT: id2, XXX, XXX
UPDATE: id3, XXX, XXX
INSERT: id4, XXX, XXX
UPDATE: id5, XXX, XXX
How to adapt the Java code in the T_Java?
Thank you MShakir, NB_LINE_INSERTED / UPDATED / DELETED are AFTER component global var. Not sure they are available if the whole stream of data is not finished. They are integers, not related to the data, to be able to retrieve IDs and other columns.
Hi,
Yes, even I could't find any component with such functionality.
Go by your proposed solution, it works...