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 derfloh 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
Joined
Jul 22, 2006
Messages
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

Replies
7
Views
537
Replies
1
Views
291
Replies
3
Views
313
Replies
4
Views
352
Replies
11
Views
622

Part and Inventory Search

Sponsor

Back
Top