Have issue with variable

Hi All,

i am new to unix..

i have an issue with my unix script...let me explain the task that i want to make script....

i prepared script which will connect data base from my linux box using sqlplus cmd...

however in that i want to use the variable like below..

select * from tablename where reference in ($variable) and status not null;

also the output should save in my linux box itself..to send back to my email id as a report in daily basis..

can anyone help me to use the variable here...so that would be great help..

Thanks in advance..

Sha..