Re: Inserting multiple rows in sqlplus

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Fri, 23 Jan 2004 03:29:22 GMT
Message-ID: <ly0Qb.101458$Rc4.663726_at_attbi_s54>


"Raj Kotaru" <raj_kotaru_at_hotmail.com> wrote in message news:67bf894f.0401221322.33dd14e3_at_posting.google.com...
> 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

Not really. But you could create an external table (if you are using 9i) and then do a select into.
Is this for school? SQLLoader does this by multiple insert statements and bind variables.
Jim Received on Fri Jan 23 2004 - 04:29:22 CET

Original text of this message