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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL*Plus Counting Updates

Re: SQL*Plus Counting Updates

From: Michael Austin <maustin_at_firstdbasource.com>
Date: Thu, 17 Jun 2004 20:27:54 GMT
Message-ID: <e9nAc.6891$TT1.1390@newssvr22.news.prodigy.com>


G Dahler wrote:

> "mouse" <spamtrap_at_safe-mail.net> a écrit dans le message de
> news:56ef365c.0406170312.208aa975_at_posting.google.com...
>

>>Hi
>>
>>I have several .sql scripts which are in the form of:
>>
>>update c_store_tb set class_lk_id = 14 where ccn = '010005';
>>update c_store_tb set class_lk_id = 14 where ccn = '010008';

>
> <snip>
>
>>Each script can be up to 5000 lines long. On running the script I am
>>told:
>>'1 row updated' or '0 rows updated' for each of the rows. The output I

>
>
> If you are un UNIX and really update either 1 or 0 row, you could spool the
> file to a text file and use grep or awk to count the lines containing "0
> rows updated" and "1 row updated"
>
> eg:
>
> updated=`grep "1 row updated" spool.lst | wc -l` and
> notupdated=`grep "1 row updated" spool.lst | wc -l`
>
> Crude, not efficient, but better than excel. I would be better to write an
> awk program and count all the same time.
>
> On Windoze, you could install cygwin and use a bash shell scipt to do it.
>
> just my 0.02
>
>

how about creating a procedure that reads the file using UTL_FILE and read each statement executes in and counts the successes.

Michael. Received on Thu Jun 17 2004 - 15:27:54 CDT

Original text of this message

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