Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> PL/SQ Cursor LOOP problem
Hello.
I’m new to Oracle programming. Will someone please help me
find a simple, elegant way to perform a cursor loop in PL/SQL
to do the following?
Suppose for discussion purposes each record in cursor c_Main
has a Group designation column with values G1, G2, …G?
(In fact the group values are character strings. No numeric index
of any kind is available from the group designations.)
For thousands of records in cursor c_Main, with an unknowable
number of groups, G1, G2, …, G?.
Read records from cursor c_Main that belong to group G1, making a
series of calculations until all records from c_Main in G1 are read,
then write a single record of values for G1 to TABLE_RESULT,
then read records from c_Main belonging to group G2, making a
series of calculations until all records from c_Main in G2 are read,
then write a single record of values for G2 to TABLE_RESULT, etc.
Repeat for G3, G4, … ?, until all groups are exhausted.
The TABLE_RESULT would have a single record for each group in
cursor c_Main. So, if there are 247 groups in cursor c_Main, there
would be 247 records in TABLE_RESULT.
Thanks in advance for the kind help! Received on Mon Mar 26 2001 - 07:03:49 CST
![]() |
![]() |