How to pass a variable as a parameter to DB2 database from shell script

I need to pass a variable as a parameter from shell script into a DB2 database.

var=bhuk_1123_Q_11/22/09

select * from tbl1 where serial_id='$var';

I have tried executing it using

db2 -tvf scriptname

Somebody please help me out with this. It is throwing an error. Please tell me how to pass arguments into DB2 databse and how to execute them.

user "$var" instead of '$var' this might help i think..

When your script is an SQL script (only ddl & sql terminated by ";" then you cannot include parameters. You can solve this by changing it to a normal shell script (or .cmd on windows). Just loose the ";" and start every line with "db2". It might be a good idea to enclose the whole command in double-quotes.