Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass Unix command line variable to Informix SQL

Status
Not open for further replies.

rsteffler

Programmer
Aug 2, 2001
10
0
0
US
I am trying to pass a command line variable using dbaccess and cannot figure out how to get Informix to recognize the variable.

Here is what I am doing:

Code:
dbaccess <database name> test.sql 2

test.sql
Code:
select * from home where type > $1

Obviously, $1 does not work. How can I get my command line variable into the .sql script without generating the .sql on the fly or substituting using sed. Oracle accepts variables from the command line. I have to think that Informix will too.

Thanks.

 
hi,

well, u can write a file in different way

file <ss> contains..

echo 'select * from ' $1 | dbaccess <database name>

$sh ss <table_name>

sanjay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top