Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Insert into 2 tables at one time
You can do it in one statement with something called a multi table insert.
INSERT ALL
INTO emp (empid, empname,deptno)
VALUES (seq_emp_id.nextval, :empname,:deptno) INTO dept (deptid,empid,deptname)
VALUES(:deptid, seq_emp_id.currval, :deptname);
-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
On Behalf Of Kean Jacinta
Sent: Friday, March 18, 2005 5:17 AM
To: oracle-l_at_freelists.org
Subject: Insert into 2 tables at one time
Hello
Need some help on this. I have 2 table
Emp
Dept
I need to insert into emp table first and then get seqid just created and insert into dept table. Would it be possible to do tat ?
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 18 2005 - 09:05:47 CST