Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ksh scrip to include various sql commands and rownum
2004-01-18, 23:50(-08), Bilal:
> I'm trying to include several insertion sql commands in a ksh
> script and after each insertion I would like to store the number of
> lines inserted into a variable. e.g
[...]
> insert into ALARM_ARC (select * from ALARM where ID_ALARM = 6);
> row_num_6=`SQL%ROWCOUNT`;
> insert into ALARM_ARC (select * from ALARM where ID_ALARM = 105);
> row_num_105=`SQL%ROWCOUNT`;
[...]
You could try to have sqlplus only display something like
row_num_6=<number>
row_num_105=<number>
and use in ksh:
eval "$(
sqlplus << EOF
...
EOF
)"
Something like:
select concat("row_num_6=", SQL%ROWCOUNT);
I guess.
-- Stéphane ["Stephane.Chazelas" at "free.fr"]Received on Mon Jan 19 2004 - 02:09:17 CST
![]() |
![]() |