Subject Re: Concatenated fields
Author pcpower099
Hi Folk!
Based on your idea I wrote this and it works!
Thanks!

CREATE PROCEDURE LINEAEVENTOS
RETURNS (
ID Integer,
LINEA Varchar(32000) )
AS
DECLARE VARIABLE evento varchar(255);
declare variable lid int;
declare variable cid int;
BEGIN
LINEA = '';
select min(fkidcon) from EVENTOSXCON into lid;
for select fkidcon, nombre from EVENTOSXCON
left join eventos on (fkidevento=idevento) where not (nombre is null) order by fkidcon
into :cid, :evento
do
if (cid = lid) then
LINEA = LINEA || ' / ' || evento;
else
begin
ID = lid;
lid = cid;
suspend;
LINEA = evento;
end
END

--- In firebird-support@yahoogroups.com, "unordained" <unordained_00@...> wrote:
>
> In 1.5, you could write a stored procedure. Approx. solution (not tested) below.
>
> create procedure x returns (team varchar(50), name varchar(32000)) as
> declare variable lt varchar(50);
> declare variable t varchar(50);
> declare variable n varchar(100);
> begin
> name = '';
> for select team, name from master left join slave on slave.fkidteam =
> master.idteam into :t, :n order by team do
> begin
> if (team != t) then
> begin
> lt = team;
> suspend;
> name = '';
> end
> team = t;
> name = name || (case when name != '' then '/' else '') || n;
> end
> if (team != lt) then
> suspend;
> end
>
>
> select team, name as players from x;
>
> ---------- Original Message -----------
> From: "pcpower099" <mmartinez@...>
>
> > I read that it could be
> > done with the newer LIST function. Should I migrate to 2.1? or is
> > there any workaround for this issue in 1.5?
> >
> > Marcelo.
> ------- End of Original Message -------
>