Solved

isql output

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

18 Experts available now in Live!

Get 1:1 Help Now