Home » Infrastructure » Unix » how many rows processed
how many rows processed [message #170277] Wed, 03 May 2006 01:44 Go to next message
raom
Messages: 22
Registered: January 2006
Location: india
Junior Member
hi
could any body please tell me how to get the number of rows processed in PL/SQL procedure

example

for the below query
SQL> update account_p set ri=power(2,28)*1+rownum;

22 rows updated.

we get a promt for number of rows updated.(22 rows updated)

if i do it from a PL/SQL scripts how can i know that how many
rows were processed.

please advise.

[Updated on: Wed, 03 May 2006 01:44]

Report message to a moderator

Re: how many rows processed [message #170288 is a reply to message #170277] Wed, 03 May 2006 03:09 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
afaik, you need to add your own code to know that..e.g. if there is a cursor , then use a variable and take the sql query used in the cursor to store the count of that query in the variable..

e.g. if the cursor is

cursor c is select * from emp;

then,

have a variable v and ,

select count(*) into v from emp;

this way you need to add your own code...
Re: how many rows processed [message #170426 is a reply to message #170288] Wed, 03 May 2006 14:45 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
SQL> create table t (col1 varchar2(10));

Table created.

SQL> set serveroutput on
SQL> BEGIN
  2     INSERT INTO t (SELECT 'test' FROM user_tables);
  3     DBMS_OUTPUT.put_line ('Rows inserted=' || TO_CHAR (SQL%ROWCOUNT));
  4  END;
  5  /
Rows inserted=198

PL/SQL procedure successfully completed.

SQL> 

[Updated on: Wed, 03 May 2006 14:47]

Report message to a moderator

Re: how many rows processed [message #170450 is a reply to message #170426] Wed, 03 May 2006 22:17 Go to previous messageGo to next message
raom
Messages: 22
Registered: January 2006
Location: india
Junior Member
May be this is the answer i am lookin for
thank u
Re: how many rows processed [message #177335 is a reply to message #170277] Wed, 14 June 2006 04:09 Go to previous message
gnuda
Messages: 5
Registered: June 2006
Junior Member
Hi

I want to do the same thing but in Warehouse Builder.

I have a mapping that has a splitter. Correct rows will be inserted to one table and rows that are not correct will be insertet to another.

So I want to count how many rows that are correct and how man that arn't.

I have created a log procedure that should log theese values. How can I get these values in a Warehouse Builder mapping?
Previous Topic: ZIP vs GZIP and Compress
Next Topic: installation of oracle on unix
Goto Forum:
  


Current Time: Mon Nov 30 11:31:05 CST 2020