Subject | How can a stored procedure construct a string made up of multiple row data? |
---|---|
Author | jeff_j_dunlap |
Post date | 2007-02-16T17:45:43Z |
Dear forum members,
I have a column of unique cities. I would like to create a
procedure, when executed returns a varchar containing all cities
enclosed in brackets, for example:
[Arlington][Beaumont][Chicago]
CREATE PROCEDURE NEW_PROCEDURE
returns (
cities varchar(2000),
as
begin
select city_tbl.city from city_tbl into :cities;
suspend;
end^
In my procedure I get a singleton select error. I guess that if I
knew how to traverse each record within the procedure, would be able
to concatenate each city into the varchar.
Thank you
I have a column of unique cities. I would like to create a
procedure, when executed returns a varchar containing all cities
enclosed in brackets, for example:
[Arlington][Beaumont][Chicago]
CREATE PROCEDURE NEW_PROCEDURE
returns (
cities varchar(2000),
as
begin
select city_tbl.city from city_tbl into :cities;
suspend;
end^
In my procedure I get a singleton select error. I guess that if I
knew how to traverse each record within the procedure, would be able
to concatenate each city into the varchar.
Thank you