Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

howto stop sqlplus script execution on syntax error

user12277715Jan 21 2015 — edited Jan 22 2015

Hello,

The script below contain by error a ";" before the where close

On execution it continue and does commit !!!

It there a way to stop execution when there is a unknow command ?

thanks

WHENEVER OSERROR exit 99 ROLLBACK

WHENEVER SQLERROR exit SQL.SQLCODE ROLLBACK

UPDATE tablecp_values

SET endValidity = TO_DATE('30/11/2014', 'dd/MM/yyyy');

where commission='302';

COMMIT;

-->

STANDARD PRE SQL > UPDATE tablecp_values
  2    SET endValidity = TO_DATE('30/11/2014', 'dd/MM/yyyy');

1868 rows updated.

STANDARD PRE SQL >     where commission='302'
SP2-0734: unknown command beginning "where comm..." - rest of line ignored.
STANDARD PRE SQL >
STANDARD PRE SQL >
STANDARD PRE SQL > COMMIT;


Commit complete.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 19 2015
Added on Jan 21 2015
7 comments
1,514 views