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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ss3944
    New Member
    • Dec 2009
    • 1

    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.


    Code:

    Code:
    var=bhuk_1123_Q_11/22/09
    
    select * from tbl1 where serial_id='$var';
    I have tried executing it using


    Code:

    Code:
    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.
Working...