Subject | Re: [firebird-support] UDF / SP functions |
---|---|
Author | Ann W. Harrison |
Post date | 2004-12-02T17:53:25Z |
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
Ann
www.ibphoenix.com
We have answers.
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 aRegards,
>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
>
>
>
>
Ann
www.ibphoenix.com
We have answers.