471,092 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

Cursor Value to Delimited String Variable??

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
Jul 19 '05 #1
2 5411
Thank you everyone for the responses, I actually don't have a manual
:) Just been doing some research on web and wasn't able to find many
good resources, so I decided to ask all the friendly people on these
listservs.

Sincerely,
Michelle
Jul 19 '05 #2
The best resource you can get for PL/SQL is the PL/SQL manual at
tahiti.oracle.com (you'll need a username/password, but it's free).

Daniel

mu********@hotmail.com (M. Guest) wrote in message news:<4a**************************@posting.google. com>...
Thank you everyone for the responses, I actually don't have a manual
:) Just been doing some research on web and wasn't able to find many
good resources, so I decided to ask all the friendly people on these
listservs.

Sincerely,
Michelle

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by tornado | last post: by
3 posts views Thread by bearclaws | last post: by
7 posts views Thread by William Gill | last post: by
7 posts views Thread by Michael Beumers | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.