After update how do u know how many records got updated

Answers were Sorted based on User's Feedback



After update how do u know how many records got updated..

Answer / svj

Using SQL Cursor Attribute,'SQL%ROWCOUNT' which gives
no.of rows affected by the most recentSQL statement (an
integer value), one can know no.of records got updated.

For Example :

VARIABLE rows_updated VARCHAR(30)
DECALRE
v_dept_no departments.department_id%TYPE := 20
BEGIN
UPDATE employees
SET salary = salary + 1000
WHERE department_id = v_dept_no;
: rows_updated := (SQL%ROWCOUNT || 'rows updated.');
END;
/
PRINT rows_updated

Is This Answer Correct ?    5 Yes 1 No

After update how do u know how many records got updated..

Answer / mahima

use @@rowcount

Is This Answer Correct ?    3 Yes 1 No

After update how do u know how many records got updated..

Answer / shail

If using SQL*PLUS then use

set feedback on

Is This Answer Correct ?    1 Yes 0 No

After update how do u know how many records got updated..

Answer / pkd

Except sql%rowcount,using returning clause with count()
function

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Oracle General Interview Questions

Describe the different type of Integrity Constraints supported by ORACLE ?

2 Answers  


How do I find my oracle client driver version?

0 Answers  


 What are the oracle DML commands possible through an update strategy?

0 Answers   Informatica,


What is cluster Key ?

3 Answers  


How to shutdown your 10g xe server?

0 Answers  






What is enter substitution variable in oracle?

0 Answers  


How to delete an existing row from a table in oracle?

0 Answers  


why can't we assign not null constraint as table level constraint

3 Answers   CTS, Wipro,


How to define an explicit cursor in oracle?

0 Answers  


What is an oracle table?

0 Answers  


What is tns service name?

0 Answers  


Can multiple columns be used in group by in oracle?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)