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

How can I introduce multiple conditions in like operator?

0 Answers  


How to list all user accounts in oracle?

0 Answers  


What do you mean by merge in oracle and how can you merge two tables?

0 Answers  


How to write a query with an inner join in oracle?

0 Answers  


What is a directory object?

0 Answers  






How to assign values to data fields in record variables?

0 Answers  


Do you know about aggregate functions? What is row num function? Can it be used all databases?

1 Answers   Bravura Solutions, Cap Gemini,


What would you use to improve performance on an insert statement that places millions of rows into that table?

1 Answers  


What is instant client oracle?

0 Answers  


Explain what are synonyms used for?

0 Answers  


Respected sir, Please send me technical questions related to oracle apps..

0 Answers  


what is the difference between UNION AND UNIONALL

4 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)