Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with Bind variable in SQL Developer 17.3

Blue BirdNov 14 2017 — edited Nov 15 2017

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

This post has been answered by Gary Graham-Oracle on Nov 14 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2017
Added on Nov 14 2017
2 comments
3,175 views