Subject | Re: [Firebird-Architect] External procedures: call for discussion |
---|---|
Author | Martijn Tonies |
Post date | 2004-04-01T08:40:24Z |
Nando, all,
MSSQL is using UDF for CREATE FUNCTION. Personally, I'd
call them Stored Functions as well. But at least MSSQL is calling
External Procedures really External Procedures :-D
Agreed.
they clash with External Functions too. So a bit of syntax and a bit of
parser
changes should do it, AFAIU.
For example, if you bring Java into the engine, perhaps the source code
can be stored, instead of "just" the declaration, while bringing several
external procedures, you can declare an external procedure/function
like you're doing now, but say, eg:
DECLARE EXTERNAL { FUNCTION | PROCEDURE } ...
[LANGUAGE { JAVA | STANDARD } ]
etc
and make the "module" a Java class etc... You get the idea.
Standard would be shared library (dll/so), while JAVA would,
obviously, use the [internal] JVM to execute it.
This would be an external function/procedure as opposed to
stored Java procedures/functions.
Martijn Tonies
> M> First, I think - and I guess we should start that - we should drop thename
> M> "UDF".Well, our UDFs really are external functions :-)
>
> it would be good but it isn't hurting right now weither.
>
> M> It's NOT an UDF, it's an "External Function", without a connection
> M> and transaction context.
>
> Amen.
MSSQL is using UDF for CREATE FUNCTION. Personally, I'd
call them Stored Functions as well. But at least MSSQL is calling
External Procedures really External Procedures :-D
> M> An UDF would be:parlance.
>
> M> CREATE FUNCTION <name> RETURNS <valid_datatype>
> M> AS
> M> BEGIN
> M> END
>
> that would rather be a "stored function", according to common DBMS
Agreed.
> I like the terms "user defined" more than I like "stored", but I likeNot only that - Stored Function need to be parsed in SQL as well. Currently,
> coherence the most, and since we have stored procedures...
> To achieve stored functions, BTW, we only miss syntax, AFAIU.
they clash with External Functions too. So a bit of syntax and a bit of
parser
changes should do it, AFAIU.
> M> I dare to raise the question: Aren't your proposed External ProceduresDepending on the language used, these can be stored or external, I think.
> M> actually internal procedures in a different language?
>
> As I understand, they're more like current UDFs with more context
> information and a way to call back into the engine. They are
> "external" in that they are pluggable and not stored inside a database
> like stored procedures and functions are. I guess both the external
> and the stored approaches have their merits.
For example, if you bring Java into the engine, perhaps the source code
can be stored, instead of "just" the declaration, while bringing several
external procedures, you can declare an external procedure/function
like you're doing now, but say, eg:
DECLARE EXTERNAL { FUNCTION | PROCEDURE } ...
[LANGUAGE { JAVA | STANDARD } ]
etc
and make the "module" a Java class etc... You get the idea.
Standard would be shared library (dll/so), while JAVA would,
obviously, use the [internal] JVM to execute it.
This would be an external function/procedure as opposed to
stored Java procedures/functions.
> M> Perhaps we could continue on your idea(s) and ask the following:With regards,
> M> - extend the current "external" API (with Java interfaces?)
> M> - bring Java more-or-less into the engine
>
> that's a good topic to discuss. From what I have read in the past I
> have developed the opinion that if Firebird has to talk to Java it
> should better do it through an internal, optimized, lean JVM.
> Thios does not rule out the concept of external, pluggable procedures
> developed in other languages. Now that I think of it, perhaps the
> "internal" JVM could be made pluggable and stay optimized at the same
> time...
>
> M> Bringing native Java into the engine would be a very powerful
> M> extension to the current PSQL language, wouldn't it?
>
> That would be terrific!
Martijn Tonies