Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert into two tables with a single query (same ID)

772087May 28 2010 — edited May 28 2010
Hello,

I want to insert two tables at the same time ( with a single query) provided that both records get inserted with the same id. How do I do this?
Table Movies
id 
name

Table Category
movie_id
cat_type
a) Insert into first table, retrieve the id (may be by using
my_sequence.currval
and then insert into another table.

issue: Makes three query to the db, I am also guessing that when multiple people try to insert there will be an issue, I might be wrong.

I don't have any other idea.

Greatly appreciated!
This post has been answered by pollywog on May 28 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2010
Added on May 28 2010
11 comments
7,813 views