Solved

isql output

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 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