Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting several records into one field

Status
Not open for further replies.

Wiszh

Programmer
Aug 3, 2000
134
US
HI,

Does anyone know how to select a series of records into one field in a query. I have a one to many relationship, and I want to retrive all of the many's into one field for a report.

Thanks
Wiszh
 
You can't do such a thing!
use something like this (this is a pl/sql solution)


declare
TYPE generic_curtype IS REF CURSOR;
my_cursor generic_curtype;
rate_unit_cr_cursor_row number;
v varchar2(10):='';
begin
open my_cursor for
select * from test1;
loop
exit when my_cursor%notfound;
fetch my_cursor into rate_unit_cr_cursor_row;
v:=v||to_char(rate_unit_cr_cursor_row);
end loop;
close my_cursor;
dbms_output.put_line(v);
end;

it is a cursor that will do the trick...
Good luck!
 
Can you provide a sample of the data and how you want to see it in the report?

Examples help to provide a workable solution :)
 
I have three tables day, vendors, and dayVendors, linking the the vendors to the days. I would like to report all the vendors that supply each day as one record:

Day1 - vendor x, vendor y, vendor z
Day2 - vendor x, vendor a, vendor b

Any ideas?

Thanx
Wiszh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top