03-29-2008
check this out.
returnedvalue=`sqlplus -s id/pwd <<EOF
set serveroutput on;
Declare
message VARCHAR2(200);
Begin
select tname into message from all_tables;
dbms_output.put_line ('tablenames '||nvl(message,''));
End;
/
set serveroutput off;
EXIT;
EOF`
X=`echo $returnedvalue | grep tablenames | awk '{print $2}'`
echo "The Query output is: "
echo "Query message 1= $X "
If you have more outputs from query, print those results in $2, $3,......
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all
I need to input values in a .csv file into my Oracle table running in Unix, I wonder what would be the command to do so...
The values are recorded in an excel file and I tried using a formatted text file to do so but failed because one of the field is simply too large to fit in the... (5 Replies)
Discussion started by: handynas
5 Replies
2. UNIX for Dummies Questions & Answers
how to pass values from oracle sql plus to unix shell script (2 Replies)
Discussion started by: trichyselva
2 Replies
3. Shell Programming and Scripting
Hi
i am calling a stored procedure from unix shell like this call
test_proc('0002','20100218');
the stored procedure was giving output
like this dbms_output.put_line(' processed earlier');
i want to see the output in the unix shell where i called.
Thanks
barani (6 Replies)
Discussion started by: barani75
6 Replies
4. Shell Programming and Scripting
i have an oracle function which returns two values, one is the error message if the function encounters anything and another one which returns a number
i need to capture both
and pass it on to unix shell script
how to do it (2 Replies)
Discussion started by: trichyselva
2 Replies
5. Shell Programming and Scripting
hi
I have two tables in oracle DB and am using a joining query which will result in the output as follows.
i need to assign it to a two dimensional array and use it for my further calculations.
the way i tried is as follows.
#!/bin/ksh
export... (1 Reply)
Discussion started by: aemunathan
1 Replies
6. Shell Programming and Scripting
Hello,
I'm trying to do a select for an Oracle table but the output gives me only filelds values without fields name as in Informix.
Is there anyway to display both in output ?
For instance, the output will be :
Name Rico
Age 30
Position Engineer
Thx, (5 Replies)
Discussion started by: rany1
5 Replies
7. Shell Programming and Scripting
Hi,
How to retrieve two different date values(min & max) from the oracle table and assign to two different variables in the shell script to process further.
With Regards (8 Replies)
Discussion started by: milink
8 Replies
8. Shell Programming and Scripting
Hi all,
My oracle procedure returns more than one value.
i need to get one value at a time upto ending value ina shell script.
Please help me..... (9 Replies)
Discussion started by: pmreddy
9 Replies
9. Shell Programming and Scripting
Friends,
I'm trying to do below in ksh script, while requesting user to provide src_db and dest_db values
1. Extract src_db and dest_db Oracle home from oratab file
2. Don't find db if it starts with comment (#)
3. Compare both values
4. Message success or exit with error if they don't... (0 Replies)
Discussion started by: homer4all
0 Replies