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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

isql question

Status
Not open for further replies.

stonemonolith

Programmer
Jul 22, 2006
4
I'm writing an isql statement that will be used to query several different databases. I've used variable names for the user, password, server and, table name. But, it won't let me use a variable name for the dbname. I used the statement, "use $dbname" but it gives me an error message. It only works when I hard code the db name - Is there a different syntax for this?
Here is the isql statement:
count=`isql -U$user -P$pass -S$server << EOF
use pubs - used $dbname in place of pubs but, didn't work
go
select count(*) for $stable
go
EOF`

Any help would be appreciated - thank you

 
What about this ?
dbname=pubs
count=`isql -U$user -P$pass -S$server << EOF
use $dbname
go
select count(*) for $stable
go
EOF`

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top