Topic
1 reply Latest Post - ‏2010-01-29T00:18:24Z by SystemAdmin
SystemAdmin
SystemAdmin
238 Posts
ACCEPTED ANSWER

Pinned topic Fetching the value of auto increment primary key after insert

‏2010-01-22T20:09:08Z |

We are trying to insert into 2 tables. The first table has an auto increment
primary key. The second table has a foreign key reference to the first table.
How can we get the primary key value of the first table so we
can insert that value into the second table?
In JDBC we can use Statement.getGeneratedKeys() :
http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#getGeneratedKeys()
How can we do this in Castiron orchestration?
Any help would be appreciated.
Thanks

Updated on 2010-01-29T00:18:24Z at 2010-01-29T00:18:24Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    238 Posts
    ACCEPTED ANSWER

    Re:Fetching the value of auto increment primary key after insert

    ‏2010-01-29T00:18:24Z  in response to SystemAdmin
    Thanks for your question. Currently this is not supported automatically in the product, and something we will look to add in the future. A possible workaround is to select the primary key value from the first table based on some other user-defined key and insert into the second table.