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!

How to use variables, get results in a grid, without the Binds dialog.

946863Jul 1 2012 — edited Jul 2 2012
Hi all,

I have recently embarked on the Oracle path, however am quite a seasoned MS SQL Server enthusiast.

I would like to be able to use inline variables within my SQL Worksheet adhoc queries without having to bother with the BIND Popup window.

I note that if I Run Script (F5) my code works flawlessly, but the results are not vary usable (i.e. not in a grid).

When I use Run Statement (Ctrl+Enter) SQL Developer pops up the Enter Binds dialog, and requires I enter a value for each variable declared.

Anyway of having my cake and eating it too?
i.e. declaring variable, setting variable and returning results in grid, without having to be disturbed with the dialogue?

Sample code here:
-----
variable vMyVariable1 number
exec :vMyVariable1 := 7
select MyColumn from MyTable
where MyColumn = :vMyVariable1;
-----
Could someone please advise me if what I am after is possible?
And if so point me in teh right direction?

Thanks
Marty
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2012
Added on Jul 1 2012
1 comment
384 views