After update how do u know how many records got updated
Answer Posted / 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 |
Post New Answer View All Answers
Differentiate between function and procedure in oracle.
Differentiate between post-database commit and post-form commit?
Difference between hot backup vs. Cold backup?
Explain drop constraint oracle?
How to bring a tablespace offline?
Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?
What are the attributes of cursor?
How to rename an index?
How to start your 10g xe server from command line?
Does oracle database need java?
A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.
How to handle a single quote in oracle sql?
How to assign a table row to a record variable?
Is the After report trigger fired if the report execution fails ?
Why we use bulk collect in oracle?