473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 5497
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns...
0
by: Ed | last post by:
Hello, I posted a question about looping with Select in a While loop, a few days ago. Repliers to my post advised me that a Cursor would be much better (thanks all for your replies). I found...
3
by: bearclaws | last post by:
I'm new to XML/XSL and need to get the last value from a string that looks like this (where the colon is the delimiter)... Computers:Drives:Firewire:Hard Drive I have an XSL file that gets...
7
by: William Gill | last post by:
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql=...
7
by: Michael Beumers | last post by:
Hello NG I've defined a cursor like the following in my COBOL Programm: DECLARE testc CURSOR FOR SELECT ... FROM ... WHERE field1 LIKE :hostvariable1 field2 LIKE :hostvariable2
10
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset...
4
by: Billy | last post by:
Hi all, I'm building a text file from a database table using the ASP Write Method and would like to position the cursor in a specific column position before writing the fields. As I loop through...
2
by: M. Guest | last post by:
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...
11
by: kimmelsd33 | last post by:
I would like some expert advice. I am writing in VB6. I am opening a tab delimited file, deleting the first 50 lines, and rewriting the file to a temp file. The temp file has about 20 columns with x...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.