The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
storing database query in a variable
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
storing database query in a variable
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
11-21-2007
Smiling Dragon
Disorganised User
Join Date: Nov 2007
Location: New Zealand
Posts: 922
Show us what the output looks like and we can probably come up with something. In the meantime, I'd suggest that you want something like:
Code:
myvariable=`long-sql-command`
Use of awk and cut should be able to split out the data in the columns.
Without one of the redirects (at a guess, you should still redirect STDERR to the log but stop redirecting STDOUT so the calling script can capture it instead).
Smiling Dragon
View Public Profile
Find all posts by Smiling Dragon
Find Smiling Dragon's past nominations received
Find Smiling Dragon's present nominations given