Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi @Shong_888 ,
I am storing max(ID) from query and in tJava.
Which I am trying to use and max(ID)+1 in
Inside tjava:
I am struggling to use it in tMap. How can I do that?
Please help!
Thanks in advance!
Amit
Define the context variable with Bigdecimal type, try this code on tJavaRow:
context.MaxID=input_row.MAX_ID.add(new java.math.BigDecimal(1));
Thanks it worked well but there is another problem, The whole case is I have to insert the new record into the map table if it's already not there which is coming from Stage table. If there are multiple new records then it is giving same ID for all records. This we need to handle. Below screenshot you can see.
Max(ID) in Map table is 248 so it Inserted 249, but 3 new records came all got assigned the same, it should go as 249, 250, 251.
I used the Numeric sequence is variable an and used in map.
Var.varIncrementedID = context.MaxID.add(new BigDecimal(Numeric.sequence("s1", 1, 1)))
Now it's working as expected.
Thanks,
Amit