Firebird News

Monday, January 17, 2005

Stored Functions idea on Firebird-Architect

From: Fabricio Araujo
Appear that some people would like
to implement some simple functions in
FB PL/SQL. There are some (easy/
not sloppy) way to implement something
like a CREATE FUNCTION statement
(will return a scalar type - varchar,
integers, floats, etc only one value).
No allowed to return resultsets.

That will make some simple functions
to be implemented as SQL functions
instead of the (trickier) UDF functions.

What do you think about?

and response From:Dmitry Yemanov

> I believe Dmitry has this already working
> in his private tree. The trick is to write
> a selectable procedure and to have DSQL
> automatically wrap it in singleton select.

Correct. Just for the record, I wanted true SQL
functions, not just an another call type for
procedures with single return parameter. So DSQL
parser should be extended to process new DDL properly,
as well as support RETURN clause (disallowing
SUSPEND/EXIT at the same time) and generate valid
selectable BLR. Also a minor ODS change is required
to clearly distinguish between procedures and functions.
I was about to propose the necessary stuff, but the
well-known "external procedures" talk happened exactly that
time and I've shut my mouth to have the external
stuff agreed on first, as these things are interrelated.
Now I'm not sure when and how we should
reopen this question. I just know that we definitely should.

No comments: