Subject | Re: Implode |
---|---|
Author | anzejbecan |
Post date | 2004-01-26T16:08:38Z |
Milan thanks for your idea. But what if I want to use some other time
"select CITY from people" or "select name||' '||surname from people" -
should I make procedure for each query separately?
I try to use string with select statement as input parameter (for
:input into :temp do...) but :input is not evaluated as select
statement but as string and of course I get error message.
"select CITY from people" or "select name||' '||surname from people" -
should I make procedure for each query separately?
I try to use string with select statement as input parameter (for
:input into :temp do...) but :input is not evaluated as select
statement but as string and of course I get error message.
> Something like this should do it:
>
> create procedure implode
> returns concat_string varchar(2000);
> as
> declare variable temp varchar(50);
> declare variable first char(1);
> begin
> concat_string = '';
> first = 'Y';
> for select name from people
> into :temp
> do
> begin
> if (first = 'Y') then first = 'N';
> else concat_string = concat_string || ', ';
>
> concat_string = concat_string || temp;
> end
> suspend;
> end
>
> I hope this gives you some ideas.
>
> --
> Milan Babuskov
> http://fbexport.sourceforge.net