Solved

isql output

Posted on 2006-06-29
2
550 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 50 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now