Subject | Re: nested queries (i think) |
---|---|
Author | markd_mms |
Post date | 2005-03-23T03:15:27Z |
--- In firebird-support@yahoogroups.com, Alexandre Benson Smith
<iblist@t...> wrote:
<iblist@t...> wrote:
> Mark,softwares,
>
> I think this task will better acomplished on the client side.
>
> You could make an selectable SP that concats the customers
> but I don't think it will be an ellegant solution.where I
>
> create procedure Customer_Software returns (CustomerID integer,
> CustomerName varchar(40), Software varchar(32000)) as
>
> declare variable wSoftware varchar(40);
>
> begin
> for
> select
> CustomerID, CustomerName
> from
> Customers
> into
> :CustomerID, :CustomerName
> do begin
> Software = '';
>
> for
> select
> SoftwareName
> from
> Software
> where
> CustomerID = :CustomerID
> into
> wSoftware
> do begin
> if (Software = '') then
> Software = wSoftware;
> else
> Software = Software + ', ' + wSoftware;
> end;
>
> Suspend;
> end;
> end
>
>
> Maybe there is some ';' missing or in wrong places (I never know
> need to put them) take this as a sample to guide you, but I wouldgo to
> do this on the client side.actually that was perfect. thank you :-)
>
> see you !
>
> --
>
> Alexandre Benson Smith
> Development
> THOR Software e Comercial Ltda.
> Santo Andre - Sao Paulo - Brazil
> www.thorsoftware.com.br