SqlPlus does not end with sql script

I have a file called script:

BEGIN ... a bunch of inserts ... COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; END; 

When I execute this in sqlplus, I get the following:

 SQL> @file.sql 382 

It is as if he is not finishing the block. I am new to using pl / sql and sqlplus, so I do not know that I am doing something wrong.

Any ideas?

+6
plsql sqlplus
source share
2 answers

You need to add another line after the final END; eg:

 / 

Just a slash as the first character in a line, and then a new line.

+9
source share

Ok, I figured it out. I should look better in the documentation before posting the question here.

In any case, at this link: http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch4.htm#sthref840

SQL * Plus treats PL / SQL routines in the same way as SQL statements, except that a semicolon (;) or an empty string does not end and does not execute a block. End the PL / SQL routines by entering the period (.) On your own in a new line. You can also end and execute the PL / SQL routine by entering a slash (/) yourself in a new line.

Instead of END, you should end with /.

0
source share

All Articles