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.