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 in Database by Neha
• 8,560 points
92 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 by Vaani
• 7,020 points

Related Questions In Database

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 in Database by Neha
• 8,560 points
373 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 in Database by gaurav
• 13,460 points
465 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,380 points
7,229 views
0 votes
1 answer

What are the different types of join in SQL?

Hi Suraj, You have a doubt regarding inner join ...READ MORE

answered May 28, 2019 in Database by sampriti
• 1,120 points
669 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 in Database by Neha
• 8,560 points
77 views
0 votes
1 answer

SQL error "ORA-01722: invalid number"

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

answered Feb 15 in Database by Neha
• 8,560 points
416 views
0 votes
1 answer

Automating Oracle script with nolio

Depending upon the details of your script ...READ MORE

answered Jul 17, 2018 in Other DevOps Questions by ajs3033
• 7,280 points
324 views
0 votes
1 answer

Is there any boolean type in Oracle database?

Nope. I don't think there is one But ...READ MORE

answered Oct 10, 2018 in Database by Neha
• 6,300 points
289 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 in Database by Vaani
• 7,020 points
57 views
0 votes
1 answer

What is an index in SQL?

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

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