![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
how to - redirect query results to a variable
How can I send the results of a query to a unix variable. I basically want to run a query then do some logic on the results. Trying to redirect the result into a variable I define in the script.
select count(*) as counter from table - nut to redirect the "count" returned from the query into a variable withing the unix script. Trying this in a teradata bteq script. Thanks for your help. |
|
|||
|
so you want to run a bteq script which gets the number of rows from a table and then you want to use this number in a variable in a unix shell script?
I think we used to redirect the output of the bteq script into a file and then (within the unix script) read the file into a variable. There is also a bteq status variable named ACTIVITYCOUNT which saves the number of rows read from any SQL statement. But I suppose this is not what you are looking for. ( see: teradata bteq manual ). You might also want to check Welcome to The Teradata Forum. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Oracle Query results to be stored in variables | ashokjaysiv | Shell Programming and Scripting | 4 | 03-16-2009 10:45 AM |
| Redirect Postgresql Select Query to Variable | uativan | Shell Programming and Scripting | 3 | 12-08-2008 04:54 AM |
| Set shell variables from SQLPLUS query results | pranavagarwal | UNIX for Advanced & Expert Users | 2 | 09-01-2008 03:26 PM |
| Redirect Query o/p to variable | Swapna173 | UNIX for Dummies Questions & Answers | 2 | 08-01-2008 07:48 AM |
| sql query results in unix shell script | skyineyes | UNIX for Dummies Questions & Answers | 1 | 06-20-2007 11:56 AM |