Forum Discussion

annika's avatar
annika
Occasional Contributor
14 years ago

Help me to get The Id of an insert in groovyskript

For the Test I need large Dataamounts in my Database. I use the Groovyskript for insert some Data. For the next insert i need the Id of the last insert. In the Past i used the comand below on a Mssql-Database and got the ID with insertData[0][0].
insertData=sql.executeInsert('insert into tbl_ordersunits (.......))
now i am using an oracle Database (i don't know if this is important). the insert still works, the Data is written into the Database, but I can't get the ID. not With insertData[0][0], insertData[0][0].toJdbc() or insertData.toJdbc(). none of them work. I don't want to search with select in the Database because The Table already contains a huge amount of Data and i have to do an insert like this very often. thats why it would take time to search for the id every time.
No RepliesBe the first to reply