Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ";" invalid char for SQL*Plus ??
In article <393d74f1_at_server.wiz.mbi-net.de>,
"Martin Schlöter" <martin.schloeter_at_mb-interactive.de> wrote:
> Hi,
> I'm new to Oracle 8i but not to database servers in general.
> I now have problems to load a command file into SQL*Plus.
>
> The command file looks like:
>
> insert into sometable (aField) values ('Hello world1');
> insert into sometable (aField) values ('Hello world2');
> ....
>
> Doing a GET followed by a RUN on this command file I'm getting the
error
> message ORA-00911: Invalid character pointing on the ";" at end of
line 1.
>
> But when I copy and paste the content of this command file via
clipboard
> into SQL*Plus all works fine.
>
> What am I doing wrong?
>
> Thanks in advance for any information.
> Regards
> Martin Schlöter
>
>
get gets a single command into the buffer -- it sees this as one big insert statement when its really many inserts. You want to use START or @ to run this script. Here is an example, I had a text file test.sql with 2 inserts in it:
ops$tkyte_at_8i> get test
1 insert into t values ( 1 );
2* insert into t values ( 2 );
ops$tkyte_at_8i> /
insert into t values ( 1 );
*
REM get fails -- it treated this as "insert into t values(1); insert into t values (2);", not as 2 statements...
ops$tkyte_at_8i> start test
1 row created.
1 row created.
REM Start ran the script sort of as it you had typed in the commands...
ops$tkyte_at_8i> @test
1 row created.
1 row created.
as does @test...
-- Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries Howtos and such: http://osi.oracle.com/~tkyte/index.html Oracle Magazine: http://www.oracle.com/oramag Opinions are mine and do not necessarily reflect those of Oracle Corp Sent via Deja.com http://www.deja.com/ Before you buy.Received on Tue Jun 06 2000 - 00:00:00 CDT