-
Hi,
Assuming that , I issue a DML statement like this,
update table_name
set col1 = 'Y'
where col1 = col2.
How do I how, How many rows for col1 got updated with 'Y'.
Badrinath
-
AFAIK there is no way to find that. There may be a couple of workarounds that though: use a SELECT statement before issuing the UPDATE OR you may be able to use cursors in PL/SQL block which is an indirect way of using a SELECT anyway.
HTH,
Ravi Kulkarni
-
Hi badrinathn
sql%rowcount can help you check if and how much rows updated.
-
Thinking about this in a very simplistic manner, two things spring to mind, which may or may not be of use:
1) If you issue the update command from a SQL prompt, you will get the message
nnn rows updated
2) If you do not have other updates on the same table concurrently with the update you wish to count, issue a query to select count(*) from the table that you wish to update using the same where clause to give you a count of the records that will be updated.
HTH
David.
-
[QUOTE][i]Originally posted by Dave_A [/i]
[B]1) If you issue the update command from a SQL prompt, you will get the message
nnn rows updated
[/B][/QUOTE]
And how SQL*Plus (or any other tool) gets this information? Exactly the same way as shawish_sababa has sugested: by isuing (behind the screen) the query:
SELECT SQL%ROWCOUNT FROM dual;
You can do the same in any application.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|