Home » RDBMS Server » Server Administration » Sqlca
Sqlca [message #374053] Tue, 22 May 2001 13:28 Go to next message
waseem
Messages: 6
Registered: May 2001
Junior Member
Is there a way to find out how many records are updated, deleted etc, using the sqlca data structure or by any other means, in PL/SQL.
Re: Sqlca [message #375269 is a reply to message #374053] Thu, 16 August 2001 08:51 Go to previous messageGo to next message
Lee Chang Jun
Messages: 2
Registered: August 2001
Junior Member
You may use "Cursor Attribute" to find out how many records are updated, deleted etc.

1. SQL%ROWCOUNT attribute with implicit cursor.
2. %ROWCOUNT attribute with explicit cursor.

Good luck!

==========================================
example : implicit cursor

VAR v_Row_count NUMBER

DECLARE
v_pin VARCHAR2(14) := '13111996900001' ;

BEGIN
UPDATE tb_rf176
SET rec_stat = '1'
WHERE pin = v_pin ;
:v_Row_count := SQL%ROWCOUNT ;
END;

/

PRINT v_Row_count
==========================================

The result of excuting above PL/SQL is as follows:

°³¹ß ÀÔ·Â:SQL>@tt1

PL/SQL procedure successfully completed.

V_ROW_COUNT
-----------
1
Re: Sqlca [message #375270 is a reply to message #374053] Thu, 16 August 2001 08:59 Go to previous message
Lee Chang Jun
Messages: 2
Registered: August 2001
Junior Member
You may use "Cursor Attribute" to find out how many records are updated, deleted etc.

1. SQL%ROWCOUNT attribute with implicit cursor.
2. %ROWCOUNT attribute with explicit cursor.

Good luck!

==========================================
example : implicit cursor

VAR v_Row_count NUMBER

DECLARE
v_pin VARCHAR2(14) := '13111996900001' ;

BEGIN
UPDATE tb_rf176
SET rec_stat = '1'
WHERE pin = v_pin ;
:v_Row_count := SQL%ROWCOUNT ;
END;

/

PRINT v_Row_count
==========================================

The result of excuting above PL/SQL is as follows:

°³¹ß ÀÔ·Â:SQL>@tt1

PL/SQL procedure successfully completed.

V_ROW_COUNT
-----------
1
Previous Topic: Re: How to convert Strign value TO_NUMBER
Next Topic: READING VARIABLE FIELD VALUES FROM A PL/SQL TABLE !!!
Goto Forum:
  


Current Time: Fri Jul 05 11:38:17 CDT 2024