Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

isql output

Posted on 2006-06-29
2
Medium Priority
?
558 Views
Last Modified: 2012-08-14
'lo perts.

Is it possible to send the output from a isql query to a variable in a shell script?

Example:

isql -b -Usa -P******<<-EOF > $variable
use prod_talis
go
select sum(AMOUNT) from CHARGE_INCURRED where BORROWER_ID = 0158258
go
EOF`

echo $variable

I'm fairly new to shell scripting and if I were to do this,it would be brilliant.

I look forward to your replies!


0
Comment
Question by:killroy03
2 Comments
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 200 total points
ID: 17010279

Try this:

variable=`
isql -b -Usa -P******<<-EOF
use prod_talis
go
select sum(AMOUNT) from CHARGE_INCURRED where BORROWER_ID = 0158258
go
EOF
`
echo $variable

PS: Those are back-ticks.
0
 

Author Comment

by:killroy03
ID: 17010350
How very odd, I did try the back ticks approach but it didn't work.

I got the idea from

http://www.dbforums.com/archive/index.php/t-326368.html

Oh well...I must've been making typos.

Thanks for the help Mike.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question