oracle sequence and tMap

One Star

oracle sequence and tMap

Hello,
i am trying to use an oracle sequence for my inserts.
I take data from one table and i export the data in several tables.
I have seen a solution which consist in modifying a tOracleOutput but my problem is that i need to keep 2 of the ids in order to insert them in the other tables.
Is it possible to get 2 id (sequence.nextval) by putting them in entry of the Tmap before exploding the data ?
I have tryed to use a tOracleRow with an hand writed request but i think that it doesn't return anything
One Star

Re: oracle sequence and tMap

Hi,
Are you compelled to use your oracle sequence ?
I've already faced this problem et I've solved it using a tRowGenerator generating number in sequence from X+1 to X+1+ tOracleInput.Rowcount, where X was read from a "log file" where I stored the last used number in my previous execution.
Regards,
André
One Star

Re: oracle sequence and tMap

for now the use of the sequence is compelled yes. there is only one sequence generating ids for the whole application. I don't think they ll turn of the application during the import.
One Star

Re: oracle sequence and tMap

So, retrieving the number of key you'll have to generate from your input (let's call it NbrRow), you should do a query as follow:
Select sequence.nextval
from dual
connect by level <= NbrRow
it will retrieve "NbrRow" nextval values.
Regards,
André
P.S. : connect by level hierachical instruction available from oracle 9 and higher, maybe 8 but not sure.