Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ksh scrip to include various sql commands and rownum

Re: ksh scrip to include various sql commands and rownum

From: Stephane CHAZELAS <this.address_at_is.invalid>
Date: Mon, 19 Jan 2004 09:09:17 +0100
Message-ID: <slrnc0n45d.41.stephane.chazelas@spam.is.invalid>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US