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!

Compare values of a cursor

PPPFP -OracleNov 26 2021

Hi all,
I want to compare values of a cursor and show if they are different or same.
Example:
I have this query:

SQL> SELECT dg.name, d.failgroup, count(1) num_disks
FROM V$ASM_DISK d, V$ASM_DISKGROUP dg
WHERE d.group_number = dg.group_number
AND dg.name IN ('RECOC2', 'DATAC2')
and d.name not like 'QD%'
GROUP BY dg.name, d.failgroup, d.state, d.header_status, d.mount_status,
d.mode_status
ORDER BY 1, 2, 3; 2 3 4 5 6 7 8

NAME FAILGROUP NUM_DISKS
------------------------------ ------------------------------ ----------
DATAC2 CELL04 12
DATAC2 CELL05 12
DATAC2 CELL06 12
RECOC2 CELL04 12
RECOC2 CELL05 12
RECOC2 CELL06 12

6 rows selected.

SQL>

I want to create a pl/sql to show if numdisks is diff between these failgroups.
Better create array ? Colletion? Cursor and subcursor ?
Appreciate help as I'm not a pl/sql programmer.

This post has been answered by Solomon Yakobson on Nov 26 2021
Jump to Answer
Comments
Post Details
Added on Nov 26 2021
2 comments
638 views