Subject UDF / SP functions
Author yartax1
Hi,

I need to do next query:

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.