-2

I am writing an sql script, whitch should ask a question, and the continuing would depend on the user's input.

I have tried this:

prompt script started
accept partitioning prompt "Do you want to partition the table? (Y/N):"
if ($partitioning=Y)
    prompt ok, it will be partitioned
else
    prompt ok, it won't be partitioned
end;

But I get

ORA-00900 exception, the if statement is not allowed here.

Is there a way to use if-then-else in a single sql script? Please give me an example, if it possible.

victorio
  • 6,224
  • 24
  • 77
  • 113

1 Answers1

-2

In the comments, I got the answer:

http://www.itbh.at/simulating-control-flow-statements-in-sqlplus/?lang=en

victorio
  • 6,224
  • 24
  • 77
  • 113