Hello,
I have this customSQL : insert into ADERTRANSCO values (?,?,SEQUENCE1.nextval) and i want to recover the value of the oracle sequence in the output file.
How do i procced ?
Thank
Hello,
I have this customSQL : insert into ADERTRANSCO values (?,?,SEQUENCE1.nextval) and i want to recover the value of the oracle sequence in the output file.
How do i procced ?
Thank
How Iāve done this in the past:
That way you have the value to use for other purposes.
Thank for your reply, but i donāt want to do this in 2 adapters service but only in 1.
I want to user the returning clause the SQL insert :
RETURNING expr [, expr ]ā¦INTO data_item [, data_item ]ā¦
like this
inert into tab(a,b) values (āxxxā,seq.nextval) returning(seq.currval) into yyy
I know that using one service is desirable. I have not found a way to do so. The 2 services approach worked just fine for me so I didnāt pursue any further. Is there an objection to doing 2 services instead of just one other than preference?
I would think using seq.curval is risky because another thread may update it between your nextval and curval calls.
Perhaps you can reference the column that is populated with the seq value in the returning clause. But Iām not even certain the JDBC adapter service (insert or custom) supports the returning clause. Perhaps it does and that will do the trick for you.
u can have a procedure which takes in the input does an insert and gives the sequence as the output.
What do you mean by āprocedureā ?
A pl/sql procedue ? If you meanās flow service, i donāt know how to do put the sequence value in the output.
To reamon : iām agree whith you : itās not possible to using the returning clause of insert wtih a JDBC Adapter.
have a db personnel create a procedure, create an adapter service āprocedure with signatureā and select the procedure from the dropdown. It will automatically give u the list of inputs and the outputs (seq no in our case).
thanks pilaire,
with solution is OK.
But I need to have a list of data in my input in addition to have the sequence in the output.
as TYPE G_TT_lg_CDMONTANT IS TABLE OF varchar2(100) INDEX BY BINARY_INTEGER;
iām donāt see them.