Subject Re: [firebird-support] sql within udf
Author Ann W. Harrison
Nick Upson wrote:
> I seem to recall that there is a reason not to do sql within a udf but
> I can't find the reference, can anyone enlighten me?

Yes. A UDF doesn't have transaction or connection context. It can
create and read blobs but can't do general database operations without
creating its own connection and transaction. That transaction will
conflict with other transactions, including the one that fired the
UDF. The exception for blobs occurs because temporary blobs are
created outside the transaction space and materialized only when the
blob id is stored in a record. Similarly, blobs can be read from a
blob id outside transaction context.