Skip to Main Content

SQL & PL/SQL

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!

passing variable in Query ?

Kodiak_SeattleMay 11 2012 — edited May 11 2012
Hi there, is there any way to pass a variable to a SQL ?

I am trying to apply a value to a variable and then have that variable used in the SQL Statement, in order to reduce repetitious entries/input/changes.
select * 
from table
where day_skey between 20120101 and 20120301;
var1 = 20120101
var2 = 20120301

this is a simple example, but I have SQL that have many areas where the day_skey value repeats within different Case Statements, and would rather just type in the value once into a variable than change it everywhere in the SQL. I use TOAD and SQL Developer for the client tool.

Thanks for lesson.
This post has been answered by indra budiantho on May 11 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2012
Added on May 11 2012
3 comments
461 views