Skip to Content
0
Former Member
Mar 23, 2006 at 07:37 AM

JDBC: Insert complex structure

19 Views

Hallo everybody,

asuming I have to DB tables:

a) <b>CUSTOMER</b> with fields

- CUSTOMER_ID

- NAME

b) <b>CONTRACT</b> with fields

- CONTRACT_ID

- CUSTOMER_ID

- CONTRACTDATE

The IDs of both tables (<b>CUSTOMER</b>, <b>CONTRACT</b>) are generated by the DB.

So the INSERT for the CUSTOMER Table would be

<i>INSERT INTO CUSTOMER (NAME) VALUES ('CLONEY')</i>

For the second insert into the CONTRACT table, I need the CUSTOMER_ID from the first insert. How can I do that in XI?

Thanks a lot, Regards Mario