Is there any way to define a value for a bind variable in the SQL editor? Or any kind of variable replacement?
I do know how to use bind variables in Oracle statements in this way
SELECT :myvar FROM dual;
and that I can then enter the value into a popup dialog. I know that the value will stay the same for the next execution. However if for some reason TOAD is closed, the values are lost and have to be entered again. So I want to store the data in the file that contains the statements e.g. with something like myvar='value'.
The purpose is to execute several statements that use the same bind variables for purposes of trouble shooting. The statements are executed manually one by one, since the next statement to execute is chosen based on the results of the previous one, so automation is not an option.
I tried to find something in the forum, but nothing really works. I did read some posts that suggested things like this
def prevdates = 'placeholder'
column prevday new_value prevdates noprint
select TO_CHAR(SYSDATE-(CASE RTRIM(TO_CHAR(SYSDATE,'day')) when 'monday' THEN 3 ELSE 1 END ), 'yyyymmdd') prevday from dual;
select &&prevdates from DUAL;
That works with F5 when executing everything at once, but I need to execute the statements one by one and if I use F9 it results in an "ORA-90000 Invalid SQL statement" for me.