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 to shutdown your 10g xe server?

0 Answers  


How to insert a new row into a table in oracle?

0 Answers  


Explain the use of full option in exp command.

0 Answers  


How to estimate disk space needed for an export job?

0 Answers  


Explain oracle instance.

0 Answers  






Explain the use of online redo log files in oracle.

0 Answers  


cursor attributes are %isopen ,%notfound,%found,%rowcount but is any attributes there other than these? please tell me asap ..

2 Answers  


What is a cluster?

2 Answers  


Please explan Why static query is more faster than dynamic query ?

2 Answers  


What is the difference between truncate & delete command?

0 Answers  


What happens if the imported table already exists?

0 Answers  


Whatz the main diff between Subquery and a Join

14 Answers   Oracle, Zeta Interactive,


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)