Solved

isql output

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Optimize bash script 20 464
shell script for killing a linux process 19 153
Replication of Nagios surveilance data 2 92
Shell script for mvn build 2 70
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…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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