|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
pass result from one query to another
Can any one help me how to pass the value of result of one query to another query. I to pass the value of result of 'select max(id) from a' into another query like update table set col =<value from last query> where ....; Code:
updatestaging()
{
xx=`$ORACLE_HOME/bin/sqlplus -s $ORA_USER_PASS 2>/dev/null << EOF
WHENEVER SQLERROR EXIT 1
SET HEADING OFF SET FEEDBACK OFF SET VERIFY OFF SET PAGESIZE 0
WHENEVER SQLERROR EXIT SQL.SQLCODE;
update XX_IMPORT_DATA
set file_id=< value from query)
WHERE FILE_ID IS NULL;
commit;
exit
EOF`
} |
| Sponsored Links | ||
|
|
|
|||
|
just replace < value from query) with the query itself.. Code:
update XX_IMPORT_DATA
set file_id=( select max(id) from a )
WHERE FILE_ID IS NULL; |
| Sponsored Links | ||
|
|
![]() |
| 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 |
| display the result of wc -l with words before and after the result | melanie_pfefer | UNIX for Dummies Questions & Answers | 3 | 04-30-2008 08:33 AM |
| Outputting formatted Result log file from old 30000 lines result log<help required> | vikas.iet | Shell Programming and Scripting | 5 | 12-02-2007 10:43 PM |
| How to store query multiple result in shell script variable(Array) | div_Neev | Shell Programming and Scripting | 4 | 11-06-2007 08:10 PM |
| passing result of query to a varibale in ksh script | ammu | Shell Programming and Scripting | 2 | 07-27-2006 02:05 AM |
| pf not working properly even with only "pass in all" and "pass out all" rules | xyyz | UNIX for Advanced & Expert Users | 4 | 12-30-2003 05:33 AM |