Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-15-2006
Registered User
 

Join Date: Jul 2006
Posts: 69
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
  #2 (permalink)  
Old 08-15-2006
Registered User
 

Join Date: Dec 2005
Posts: 49
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0