Re: Inserting multiple rows in sqlplus

From: Ana C. Dent <anacedent_at_hotmail.com>
Date: Thu, 22 Jan 2004 18:22:01 -0800
Message-ID: <dz%Pb.15988$AA6.9544_at_fed1read03>


Raj Kotaru wrote:
> Hi,
>
> In sqlplus, I can insert a single row using:
>
> insert into employee
> (name, salary, hiredate)
> values
> ('xyz', '86378', sysdate);
>
> Is there a modification of the insert command that will allow me to
> insert more than one row into a table without having to resort to
> multiple "insert into ..." statements?
>
> For example, can I insert two rows via something that lloks like:
>
> insert into employee
> (name, salary, hiredate)
> values
> {
> ('xyz', '86378', sysdate),
> ('abc', '84249', sysdate-1)
> };
>
> Here I am assuming that { } encloses all valid rows, with () enclosing
> a single row within the surrounding {}.
>
>
> I do not want to use the sql loader, PL-SQL, or SQL-PLUS constructs
> like functions, scripts, and stored procedures.
>
> Thanks
> Raj

INSERT INTO EMPLOYEE AS
    SELECT A.NAME, B.SALARY, C.HIREDATE
    FROM NAME_TABLE A, SALARY_TABLE B, HIREDATE_TABLE C     WHERE A.SSN = B.SSN
      AND A.SSN = C.SSN; Received on Fri Jan 23 2004 - 03:22:01 CET

Original text of this message