Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Count number of rows for TWO QUERIES USING MINUS OPERATOR

699403Mar 4 2010 — edited Mar 4 2010
I have the following piece of sql, i would like to know how could i programatically using plsql count the number of rows returned by the following statement. I know that %ROWCOUNT returns the rowcount for the last execute INSERT, UPDATE, DELETE and SELECT INTO statement. Any help is much appreciated thanks.
select *
from admt1m4.usr@tcprod u
where u.authoriztion = 'Omf99FullUsage'
and u.obid in (select right from admt1m4.usrtogrp@TCPROD ug where ug.left in 
(select obid from admt1m4.usrgrp@tcprod g  
where g.participant not in ('super user grp', 't1_WbsPSAnalystGrp')))
and u.activeuser = '+'
MINUS
select * 
from admt1m4.usr@TCPROD u
where u.authoriztion = 'Omf99FullUsage'
and u.obid in (select right from admt1m4.usrtogrp@TCPROD ug
where ug.usrgrpname in ('super user grp', 't1_WbsPSAnalystGrp'))
and u.activeuser = '+'
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2010
Added on Mar 4 2010
2 comments
1,067 views