![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sqlplus error output to different error log file | tomasba | Shell Programming and Scripting | 2 | 03-25-2009 08:59 AM |
| Getting output parameter in sqlplus | risshanth | UNIX for Dummies Questions & Answers | 1 | 04-01-2008 02:32 PM |
| sqlPlus output with new line character | decci_7 | UNIX for Advanced & Expert Users | 2 | 03-08-2008 04:54 PM |
| File Format issue: Output of sqlplus | deepakgang | UNIX for Dummies Questions & Answers | 2 | 10-25-2007 04:56 AM |
| Sqlplus | antkiu | Shell Programming and Scripting | 4 | 09-14-2006 01:36 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
output arguments from a sqlplus
Hi.
I need to output a 4 queries result into another application using result=`sqlplus -s ${3}/${4}@${2} << EOF ... query1 query2 query3 query4 .... echo "$metrics1" and returning those individual values into another app. (query1 and 3compute one value, query 2 and 4 compute 4 values. All of them floats) For a normal situation I output the values this way, server_avail1=`echo $tt1| awk '{print $1}'`; server_term1=`echo $tt1| awk '{print $7}'`; server_menu_avail=`echo $tt1| awk '{print $2}'`; server_menu_avail=`echo $tt1| awk '{print $3}'`; ............... the problem I'm facing is sometimes some values of a query are returned NULL and thus aren't echoed, which breaks my static outputting (and if the 1st value of the 2nd query goes NULL, the values that goes into server_menu_avail is the 2nd val of the 2nd query, etc) To gain a little control, I tried to force substituting those NULLs with a 'NULL' word echo "$scfmetrics1" | sed 's/^$/NULL/g' but it's getting an extra NULL between the result of query1 and 2, and query 3 and 4. Eg: 0 NULL NULL 100 NULL 100 100 NULL 0 NULL NULL 88.46 NULL 99.12 100 Any idea how to skin this rabbit? |
| Bookmarks |
| Tags |
| null, sed, sqlplus |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|