Number of rows affected by an UPDATE in PL SQL

0 votes
There is a PL/SQL function  which is running on Oracle 10g) in which I have to update some rows. Can I know how to find out how many rows were affected by the UPDATE? While I was executing the query manually it tells me how many rows were affected, But how do I get the number in PL/SQL?
Feb 14, 2022 in Database by Neha
• 9,060 points
989 views

1 answer to this question.

0 votes

You can try using the following query:

SELECT COUNT(DISTINCT programme_name) AS Count,
  programme_type AS [Type] 
FROM production 
WHERE push_number=@push_number 
GROUP BY programme_type

DISTINCT COUNT(*) will return a unique row for each unique count. 

 COUNT(DISTINCT <expression>): gives you expression for each row in a group and returns the number of unique, non-null values.

answered Feb 14, 2022 by Vaani
• 7,020 points

Related Questions In Database

0 votes
0 answers

PL/SQL ORA-01422: exact fetch returns more than requested number of rows

I am getting this error: DECLARE * ERROR at line ...READ MORE

Aug 19, 2022 in Database by Kithuzzz
• 38,010 points
797 views
0 votes
1 answer

How do I limit the number of rows returned by an Oracle query after ordering?

Use a subquery for this like: select * from ...READ MORE

answered Sep 15, 2022 in Database by narikkadan
• 63,420 points
1,699 views
0 votes
1 answer

Ordering by the order of values in a SQL IN() clause

Use MySQL's FIELD() function: SELECT name, description, ... FROM ... WHERE id ...READ MORE

answered Feb 4, 2022 in Database by Neha
• 9,060 points
4,448 views
0 votes
1 answer

Maximum number of rows of CSV data in excel sheet

The maximum number of characters per cell ...READ MORE

answered Apr 6, 2022 in Database by gaurav
• 23,260 points
7,557 views
0 votes
1 answer

Please name some online websites to compile and run PL/SQL?

For executing Oracle SQL queries and PL/SQL ...READ MORE

answered Feb 11, 2022 in Database by Neha
• 9,060 points
1,110 views
0 votes
1 answer

SQL error "ORA-01722: invalid number"

When an effort is made to convert ...READ MORE

answered Feb 15, 2022 in Database by Neha
• 9,060 points
2,626 views
0 votes
0 answers

Oracle SQL: Update a table with data from another table

Table 1: id name ...READ MORE

Aug 13, 2022 in Database by Kithuzzz
• 38,010 points
784 views
0 votes
0 answers

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

I experimented with the following code in ...READ MORE

Aug 22, 2022 in Database by Kithuzzz
• 38,010 points
5,450 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL Server?

MERGE INTO YourTable T USING ...READ MORE

answered Feb 3, 2022 in Database by Vaani
• 7,020 points
591 views
0 votes
1 answer

What is an index in SQL?

An index is used to speed up ...READ MORE

answered Feb 3, 2022 in Database by Vaani
• 7,020 points
435 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP