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,020 points
1,365 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,070 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,000 points
1,140 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,600 points
2,217 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,020 points
5,353 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
8,682 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,020 points
1,461 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,020 points
3,176 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,000 points
1,023 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,000 points
6,519 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,070 points
832 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,070 points
691 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