Command Window replacement variables?

jrow

Member²
How can I clear replacement variables in the command window?

In a command window do the following.

select '&repvar' from dual;

You will be prompted in a pop-up for 'repvar'.
If you run the select again, the pop-up will contain the last value entered.

If you do the following:

undefine repvar

When you run the select, the old value remains.
 
Yes, there is a need to clear it. When I run a script that has an UNDEFINE in it, the variable should become undefined.

I can't tell from one run to the next if/when the variables are established correctly or not.

Thanks - JR
 
i agree, there is a need to be able to clear it, but that will be coding fun since PLSD probably isn't getting the value from Oracle (it is a Window's popup where the user types in the value to use).

could you use a Test Window and ':' instead of '&'?
 
Yes, there is a need to clear it. When I run a script that has an UNDEFINE in it, the variable should become undefined.
It is undefined after using UNDEFINE (you can check this by using define again).

When you are prompted later for the previously undefined variable, the old value is displayed again as a default for your convenience. There is no need to clear this temporary default value.
 
Marco,
But, I thought, that when prompted by PLSD for a value for the substitution, if there is a value in the PLSD pop-up window, clicking OK tells PLSD to pass that value to Oracle to use. Unless I clear the suggested value before clicking OK.
 
But, I thought, that when prompted by PLSD for a value for the substitution, if there is a value in the PLSD pop-up window, clicking OK tells PLSD to pass that value to Oracle to use.
That is correct.
Unless I clear the suggested value before clicking OK.
If you clear it, the substitution variable will be empty, and passed to Oracle as such.
 
Back
Top