Below you could see template of SQL script that i'm trying to execute on sqlplus:
WHENEVER SQLERROR EXIT 1 ROLLBACK
WHENEVER OSERROR EXIT 1 ROLLBACK
BEGIN
-- Doing some Insert
END;
/
INSERT INTO TMP_TABLE VALUES('A', 'B')
COMMIT;
QUIT;
/
This script is available in a file (Test1.sql) on my local system and I am running this query by connecting to Oracle through Windows command line console. Typing below line on cmd.
C:\Users\myself> sqlplus UNAME/PWD@//DB IP:PORT/SID @C:\Users\Test1.sql
In SQL script I purposeful didn't terminated one statement (INSERT INTO...) with a semi colon (see above). Now when i run this script by following above instructions, program run successfully and prints a message:
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Apr 6 16:50:19 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
PL/SQL procedure successfully completed.
Commit complete.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64
bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
When I run the same set of scripts on my SQL Navigator tool, I get below error and that is correct:
[10]: (Error): ORA-00933: SQL command not properly ended
I am not understanding why the script is not reporting this error and instead displaying message like 'Commit complete'.
Can you tell me how can i make my script throw this error on console when i'm trying to run the same through sdlplus using Windows command console?