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!

Return SQL Count to Variable

Status
Not open for further replies.

sweevo

Programmer
Jan 30, 2002
182
0
0
GB
Hello,

Is it possible to call a SQL statement from a script (Bourne Shell) and assign its output to a variable - if possible without having to create and delete temp output files?

The SQL is a Count query, that will return one value. I want to use this value for comparisons within the script.

Any help would be appreciated.

Thanks.
 
faq822-2218

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
The database is ingres.

I've had a look at the FAQ but am having difficulty applying it to what I need.

Thanks
 
here's another hint:

Code:
#/bin/ksh
shellCount=$(yourIngresQueryGoesHere)

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top