Subject Re: UDF / SP functions
Author yartax1
Thanks for the suggestion. Sorry, I'm afraid don't understand the
trick to pas SP into UDF! You suggest me to create a UDF like others
functions, right? To do that, I must create a .dll and create an UDF
entry point to the function created in that dll! Is that ok? I think
it's a bit harder to simply get simple string functions, are there any
library with this kind of functions posted anywhere?

Very thanks Ann!

--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
> Julian,
>
> Stored procedures and UDF's aren't interchangeable. Stored
> procedures aren't functions and can't be used as if they were
> values, even if they produce a single valued result. You can
> rewrite your stored procedure as a UDF and use it the way you
> want - though I'd suggest doing something to set a value for
> the output in the case that LEN = 0.
>
> Regards,
>
>
> Ann
>
> >Select a.* from no_nomina a
> >inner join no_contrato b on a.empleado = b.empleado and a.orden =
> >b.orden and a.empresa = b.empresa
> >inner join usuario_centro c on sysleft(destcon,2) =
sysright(c.centro,2)
> >where c.idusuario = 1
> >
> >------------------------
> >
> >Where sysleft and sysright are SP like:
> >
> >SET TERM ^ ;
> >
> >CREATE PROCEDURE SYSLEFT (
> > CADENA VARCHAR(255),
> > LEN INTEGER)
> >RETURNS (
> > OUT VARCHAR(255))
> >AS
> >begin
> > if ( LEN = 0) then BEGIN
> > EXIT;
> > END
> > OUT = substr(CADENA,1,len);
> > suspend;
> >end
> >^
> >
> >SET TERM ; ^
> >
> >-------------
> >
> >When I do Select * from sysleft('hello',2) works perfectly but in my
> >first query didn't. How can I do that kind of query?
> >
> >Thanks.
> >Julian.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
>
> Regards,
>
> Ann
> www.ibphoenix.com
> We have answers.