![]() |
|
|
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 |
| script for nested rlogin and telnet | mcburke38 | Shell Programming and Scripting | 6 | 03-19-2009 10:37 AM |
| sed in awk ? or nested awk ? | varungupta | UNIX for Advanced & Expert Users | 11 | 02-08-2008 10:34 AM |
| Nested Arrays | guysporty | Shell Programming and Scripting | 5 | 04-13-2005 08:44 AM |
| nested read | TioTony | Shell Programming and Scripting | 2 | 03-05-2004 03:11 PM |
| Nested calls | omran | Shell Programming and Scripting | 6 | 08-16-2002 05:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
If you mean: a) can this nested SQL be run in a shell script? Code:
{
sqlplus un/pw <<EOF
select col_a
, col_b
from table_a a
where exists (
select 1
from table_b b
where a.col_a = b.col_b
);
EOF
} | while read COL_A COL_B
do
echo $COL_A $COL_B
done
Answer: Yes or b) can this nested SQL be run in a shell script? Code:
{
sqlplus un/pw <<EOF
select col_a
from table_a a;
EOF | while read COL_A
do
sqlplus un/pw <<EOF
select col_c
from table_b
where col_a = ${COL_A};
EOF
} | while read COL_B
do
echo ${COL_B}
done
done
Answer: Yes Last edited by tmarikle; 09-21-2005 at 12:13 AM.. |
|
||||
|
Code:
{
typeset IFS='
'
sqlplus -s un/pw <<EOF
select t.table_name, c.column_name
from
(select table_name
,column_name
from all_tab_columns) c
,(select table_name
from all_tables) t
where t.table_name = c.table_name
and t.table_name = 'PLAN_TABLE'
;
EOF
} | while read line
do
echo "$line"
done
TABLE_NAME COLUMN_NAME
------------------------------ ------------------------------
PLAN_TABLE STATEMENT_ID
PLAN_TABLE TIMESTAMP
PLAN_TABLE REMARKS
PLAN_TABLE OPERATION
PLAN_TABLE OPTIONS
PLAN_TABLE OBJECT_NODE
PLAN_TABLE OBJECT_OWNER
...
27 rows selected.
|
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|