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.
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)