Hi
I would like to define bind variable and assign value to it (only once) and then use it in SQL code. If I try the same in SQLPlus work Ok. After I assing value to variable, content is remembered but not in SQL Developer.
In SQLPlus I type:
Variable Test Number;
Exec :Test := &Input;
Select *
From Departments
Where Department:_Id = :Test;
I'm then asked for value only once, when I execute Line 2.
In SQL Developer::
Variable Test Number; -- Select and F9
Begin -- Select 3 lines and F9
:Test := &Input;
End;
Select *
From Departments
Where Department_Id = :Test;
After I execute above anonymous block I get first prompt dialog for Bind variable (Enter Binds) and then again for substitution value (Enter Substitution Variable). I should be asked only for Substitution variable.
When I execute SQL I'm asked again for variable value. How to define Bind variable here so I will assign value only once and then this variable value will be remembered for the rest of the session?
BB