DECLARE
localvar char;
BEGIN
localvar := &ENUMBER;
IF localvar ='A' then
dbms_output.put_line('Please proceed to Level1');
ELSIF localvar='B' or localvar='C' then
dbms_output.put_line('Please proceed to Level2');
ELSIF localvar='D' then
dbms_output.put_line('Please proceed to Level3');
ELSE
dbms_output.put_line('Invalid Entry');
END IF;
END;
I am trying to prompt the user for input using a substitution variable in Oracle, but I am having a problem with this. Any help is appreciated.
Best Answer
When the user types
A
, the code will look like:Notice the line
localvar := A;
. This is obviously incorrect, as A is an unknown identifier.Either type
'A'
, or put apostrophes in the code: