passing value to a variable in a SQL

Hi Folks,

This is a small chunk of the bigger problem which i am facing and some help here will help me resolve the rest of the issue.

Problem is that i need to pass the value of a variable from a shell script to a SQL query (infact a lot of SQL's)

i have the following solution but somehow i don't like this solution because this will lead to some major changes (additional lines) in my already too big script.

echo "enter the date"
read today
echo "select * from informix.table" > abc.sql
echo "where t_date < $today - INTERVAL(5) MONTH TO MONTH" >>abc.sql

I hope am clear in describing the problem, if not please let me know.
A quick help will be very much appreciated.

Cheers,
K

Can you not use a here document?

its an alternative but i am searching for a method which can pass the variable from shell script to the Sql's (have a lot of SQL's using the same variable 'current date' but doing different tasks and using a here document will make the script messy)

*I do not know Informix

But. In Oracle you can group dozens of sql statments into one single script file. They execute sequentially. But you execute the script just once.

*disclaimer

I am not sure if this helps, but I pass vars from ksh script to oracle sql scripts using the following....

sqlplus -s $DBUSER/$DBPASS @my.sql > output.txt $SHELLVAR;

Then from within my.sql file I reference the input var with '&1'.