SQL*Plus (MOSC)

MOSC Banner

Conditional branching in SQL script

edited Mar 22, 2013 4:20AM in SQL*Plus (MOSC) 9 commentsAnswered ✓
Hi,

I have a SQL script at the beginning of which is a small PL/SQL block which checks for something and produces the result of the check as e.g. a value in a bind variable.

What I would like to do is exit the script or continue depending on the result of the check.

WHENEVER SQLERROR does not solve it, because the block does not produce any error and even if it did, it would not be a good solution, because the SQL commands that follow

in the script can legally produce errors (well known scenario of dropping and recreating tables).

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center