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!

Executing a sql file through an anonymous block

CrazyAnieAug 10 2010 — edited Aug 10 2010
Hi,

I am encountering an error while trying to execute a SQL file through an anonymous block:

PROMPT Press y if you want to proceed with the current values, or press n if you want to re-enter the values
ACCEPT cChoice CHAR Prompt 'Enter y or n: '

DECLARE
cChoice CHAR(1) := '&cChoice';

BEGIN
IF cChoice = 'y'
THEN
DBMS_OUTPUT.PUT_LINE('Starting with the refresh process');
DBMS_OUTPUT.PUT_LINE('---------------------------------------------');

ELSE IF cChoice = 'n'
THEN
start test.sql;
END IF;
END;
/

I am getting an error if I enter n at the command prompt. Where am i going wrong?

Kindly advice.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2010
Added on Aug 10 2010
4 comments
1,381 views