Subject Re: Record Collation
Author svein_erling
Hi Ranando!

Why not modify parts of AllTenantNames to something like:

> > For
> > Select GTN."Names"
> > From "Leases" L
> > Join "GetTenantNames"(L."LeaseKey") GTN ON 1=1
> > Into "Names"
> > Do
> > Begin
> > Suspend;
> > End

Though I must admit that I do not use stored procedures very often,
and have only ever seen joining to stored procedures on this list (and
as such, it is likely that things won't work). Nor do I think it will
help much in terms of speed, but I thought it might be worth a try.
Maybe it is using executable stored procedures within a selectable
stored procedure that slow down your programs?

Set

--- In firebird-support@yahoogroups.com, "Ranando King" wrote:
> Thought about that. Not viable. For one thing, I need this result
> set available to other querys. For another thing, fumbling through
> all the records and creating the strings in the client is slower in
> some cases. The real catch is that doing it in the client combined
> with the "calculated fields" method I'd have to use on every query
> using this stored procedure would slow the whole program down
> considerably. I'm trying to avoid client calculated fields
> altogether. Is there a better way?
>
> R.
> > It works just fine save for the fact that its kinda slow when
> > called by the following procedure:
> >
> > ALTER PROCEDURE "AllTenantNames"
> > RETURNS
> > (
> > "LeaseKey" INTEGER,
> > "Names" VARCHAR(128) CHARACTER SET WIN1251
> > )
> > AS
> > Declare Variable name VarChar(32);
> > Begin
> > For
> > Select L."LeaseKey"
> > From "Leases" L
> > Into "LeaseKey"
> > Do
> > Begin
> > Execute Procedure "GetTenantNames" ("LeaseKey")
> > Returning_Values ("Names");
> > Suspend;
> > End
> > End
> > ^
> >
> > SET TERM ; ^
> > COMMIT WORK;