Re: functions as SPL's
Posted in 1998
aurelio wrote:
>
> I have tried to declare a function, but I receive a syntax error. I need
> to return values, so it would be more corret using functions, instead
> procedures. Although I can do it with procedures. Doesn't exists this
> statement (CREATE FUNCTION -- END FUNCTION) ?
> I am using SQL for Dynamic Server 7.3 (Unix).
>
> Thak you.
You can use a procedure which returns one return value as a function:
CREATE PROCEDURE myproc(....) RETURNING SMALLINT...
END PROCEDURE
Then you can do:
SELECT mycolumn, myproc(myothercolumn, "answer") + 42 ...
--Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
---
If all else fails, read the instructions and the release notes.
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/
---