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!

WHENEVER SQLERROR - How to not display error message

Robert_D.Jan 26 2016 — edited Jan 27 2016

Hi All,

how to not display error message, after execution of 1 step in this script, but display successfully command execution in 2 step.

This solution should work without using PL/SQL, only SQL and SQL Plus commands.

WHENEVER SQLERROR CONTINUE SQL.SQLCODE

ALTER TABLE test DROP COLUMN project_id;

WHENEVER SQLERROR EXIT FAILURE SQL.SQLCODE

ALTER TABLE test ADD project_id NUMBER;

Output:

Error starting at line : 4 in command -

ALTER TABLE test DROP COLUMN project_id

Error report -

SQL Error: ORA-00904: "PROJECT_ID": invalid identifier

00904. 00000 -  "%s: invalid identifier"

*Cause:  

*Action:

Commit

table TEST altered.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2016
Added on Jan 26 2016
12 comments
2,723 views