I have a file with the folowing 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's as if he's not ending the block. I'm new to using pl/sql and sqlplus, so I don't know if I'm doing something wrong.
Any ideas?
Solution 1. 1) If it is a windows SQL*PLus, click on File/Cancel. 2) Press Cntrl + C which will also stop the execution.
Answer: To execute a script file in SQLPlus, type @ and then the file name. The above command assumes that the file is in the current directory. (ie: the current directory is usually the directory that you were located in before you launched SQLPlus.) This command would run a script file called script.
In iSQL*Plus click the Logout button to exit the Oracle Database. Commit on exit, or commit on termination of processing in iSQL*Plus, is performed regardless of the status of SET AUTOCOMMIT.
Running a Script as You Start SQL*PlusSQL*Plus starts and runs the script. Include your username, a slash (/), and your password as the first line of the file. Follow the SQLPLUS command with @ and the filename. SQL*Plus starts and runs the file.
You need to add one more line after the final END; like this:
/
Just a slash as the first character on the line, and then a new line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With