#ifndef or #ifdef in SQLPLUS
13030Mar 7 2011 — edited Mar 8 2011I want to write a SQL*Plus script that has something like an #IFNDEF or #IFDEF at the top.
In otherwords, something like
#IFNDEF my_variable THEN
DEFINE my_variable='N'
#ENDIF
Then later in the body of my program, I can refer to it as usual and know that it will not prompt the user to enter the variable:
BEGIN IF x OR &my_variable = 'Y' THEN ; ... END;
And the main point being that if the variable is set before this script is called, then the above DEFINE will not overwrite it.
Does SQL*Plus provide this capability?
And as you can see above, a bind variable cannot be used.
Preferably in Oracle 10g or earlier.
Edited by: siliconalley on Mar 8, 2011 4:30 PM