Insert into multiple tables

11 views
Skip to first unread message

Reginaldo Junior

unread,
Aug 1, 2023, 8:57:50 AM8/1/23
to integra
I have three tables that relate to each other by ID controlled via Sequence in an Oracle database.

Table_01: ID
Table_02: ID, ID_Table01
Table_03: ID, ID_Table01, ID_Table02

I need to insert record A in Table_01, then I need to recurrate this ID to insert record B in Table_02 referencing the ID of the first Insert and then another record C in Table_03 referencing the two IDs generated in previous inserts, how is this possible in Integra. Sky guaranteeing that I will always be working with the real ID?

Ronaldo Kazu Theodoro Kuguyama

unread,
Aug 1, 2023, 10:46:01 AM8/1/23
to Reginaldo Junior, integra
Hi Reginaldo!

Have you tried to use "returning id" in the insert query? Then you will be able to use this id in the next insert operation.

Follow this 2 links with some examples:


--
You received this message because you are subscribed to the Google Groups "integra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to integra-sky...@skyone.solutions.
To view this discussion on the web visit https://groups.google.com/a/skyone.solutions/d/msgid/integra-sky/fb88250e-0856-4aa3-8919-b6877a66d24fn%40skyone.solutions.

https://skyoneconnect.com.br/
Reply all
Reply to author
Forward
0 new messages