Different behaviour of substitution variables in Command Window and SQLplus

Thomas Keck

Member
I have recognized a different behaviour in handling substitution variables between the Command Window and SQLplus:

I try to submit the commit or rollback command by using it as content of a substitution variable.

In the command window the following works:

SQL> define bestaetigen=rollback
SQL> &bestaetigen;

Rollback complete

If I do the same in SQLplus, I get an error message:

SQL> define bestaetigen=rollback
SQL> &bestaetigen;
SP2-0734: Unbekannter Befehl ab "&bestaetig..." - restliche Zeile ignoriert.

How can I make SQLplus behave like the command window?
 
I've used this technique a lot when running fix-it scripts in sqlplus and never had a problem. But alway in a procedure.

Example:

SQL> define debugy=rollback;
SQL> begin
2 &debugy;
3 end;
4 /
old 2: &debugy;
new 2: rollback;

PL/SQL procedure successfully completed.

When I use it on a command line, I get the same results as you.
SP2-0042: unknown command "&debugy" - rest of line ignored.
 
Back
Top