The UNIX and Linux Forums  

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



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
assign awk command result to a variable dedmakar Shell Programming and Scripting 9 01-24-2009 07:37 AM
How to pass the result of an anonymous pl/sql block back to a shell script variable ttunell Shell Programming and Scripting 2 08-01-2008 04:36 PM
assign subst|grep|sed command result to a variable snowbiker99 Shell Programming and Scripting 5 11-14-2007 07:08 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
how to assign sql output data to shell script variable kattics Shell Programming and Scripting 1 07-07-2006 04:57 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-06-2009
little_wonder little_wonder is offline
Registered User
  
 

Join Date: May 2009
Posts: 26
Thumbs up How to assign the result of a SQL command to more than one variable in shell script.

Hi Friends...

Please assist me to assign the result of a SQL query that results two column, to two variables.

Pls find the below code that I write for assigning one column to one variable. and please correct if anything wrong..

#! /bin/sh

no='

sqlplus -s uname/password@DBname <<EOF

set heading off
set feedback off

SELECT no from table_A where no=123;

exit

EOF`

--------------------------------------------------------------------

please help me, that I want to assign the result of below query to two variables 1.no and 2.name


select no,name from table_A where no=123


Thankyou for all of your answers!!
 

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 On




All times are GMT -4. The time now is 06:44 AM.


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-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0