Hello,
I am fairly new to Oracle and PL/SQL, but I am trying to loop through
some records and then insert a column value for each record into one
variable, creating a comma-delimted string (for display on a report).
I know the SQL part works, and I have it FETCHING ok, but the
delimited part has me stumped. It is supposed to bring back 5 records
and brings back only 4: 1 is empty and 2 are duplicates. Below is the
section of my code that is supposed to do that--What am I doing wrong?
Do I need to include more info to get the help I need?
DECLARE s_AppSubType VarChar2(255);
DECLARE x VarChar2(255);
DECLARE y VarChar2(255);
DECLARE CURSOR ApplicationFor IS
SELECT InfoDesc
FROM tbl1, tbl2
WHERE tbl1.folderrsn = argFolderRSN
AND tbl1.infocode = tbl2.infocode;
FOR ApplicationFor_cur IN ApplicationFor LOOP
FETCH ApplicationFor INTO y;
x := x ||', '|| y;
END LOOP;
s_AppSubType := x;
Sincerely,
Michelle