Subject | feature request |
---|---|
Author | Holger Klemt |
Post date | 2003-02-08T19:43:53Z |
in a customer project we are also working with an ibm as400 and they have a
nice
feature there, which could be hopefully easy to implement in firebird:
in simple words:
declare a udf to use a stored procedure
or
use any stored procedure as a function
for example when i have a simple select on a stored procedure, it
works in firebird like
select * from stored_proc(param1)
the idea is to use the procedure similar to a udf, for example
select sales.*, sp_customer_caption(id_customer) from sales
as far as i have tested this, it does not work until now, but it would be
really
helpful, especially to avoid a lot of tables used in one select, which
definitly
makes problems in the optimizer (a udf only used in the field list does not
make changes to the optimizers plan).
We use a function which gives us a caption for a foreign key field without
adding the foreign table to the select. since the procedure only gives one
record back and has one input and one output param, it is really easy to
optimize and give a flexible functionality, because currently i see no
flexible
way to use table data in a udf.
--
See you on First European Firebird Conference in May in Fulda, Germany
http://www.firebird-conference.com
IBExpert - The most Expert for InterBase and Firebird --- www.ibexpert.com
HK Software - Holger Klemt - Huntestrasse 15 - D-26135 Oldenburg
Telefon Telefax +49 700 IBEXPERT (42397378) www.h-k.de
Schulungen - Projektunterst�tzung - Delphi - InterBase - AS/400
nice
feature there, which could be hopefully easy to implement in firebird:
in simple words:
declare a udf to use a stored procedure
or
use any stored procedure as a function
for example when i have a simple select on a stored procedure, it
works in firebird like
select * from stored_proc(param1)
the idea is to use the procedure similar to a udf, for example
select sales.*, sp_customer_caption(id_customer) from sales
as far as i have tested this, it does not work until now, but it would be
really
helpful, especially to avoid a lot of tables used in one select, which
definitly
makes problems in the optimizer (a udf only used in the field list does not
make changes to the optimizers plan).
We use a function which gives us a caption for a foreign key field without
adding the foreign table to the select. since the procedure only gives one
record back and has one input and one output param, it is really easy to
optimize and give a flexible functionality, because currently i see no
flexible
way to use table data in a udf.
--
See you on First European Firebird Conference in May in Fulda, Germany
http://www.firebird-conference.com
IBExpert - The most Expert for InterBase and Firebird --- www.ibexpert.com
HK Software - Holger Klemt - Huntestrasse 15 - D-26135 Oldenburg
Telefon Telefax +49 700 IBEXPERT (42397378) www.h-k.de
Schulungen - Projektunterst�tzung - Delphi - InterBase - AS/400