In a Firebird UDF, can you establish a connection back to the database?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

In a Firebird UDF, can you establish a connection back to the database?

Post by stevel » Fri 31 Dec 2010 11:27

Short of a qualified answer, I am forced to post this question here in hope of searching expert advice:

Question: In a Firebird UDF, can you establish a connection back to the database (client/server mode)?

Using: Delphi 2010, Firebird 2.5, UniDac 3.50

I'm writing a Firebird UDF that needs to be able to execute a stored procedure. The stored procedure is based on a simple SELECT statement.

UniDac UniConnection and UniStoredProc components are being used for creating a connection back to the database and retrieving data.

However when executing the function in Firebird (after having
successfully declared it in the database), the system freezes.

I am certain that it freezes at the point where the connection to
database is being made.


So my question is:

1. Is it possible (ie. allowed) for (the code inside) a UDF to establish a connection to the database?

2. If it is possible, is there anything special that needs to be done in code to get UniConnection to connect without having it freeze?



Thanks in advance for any expert advice.


Sincerely,
Steve Faleiro
email: [email protected]

AndreyZ

Post by AndreyZ » Tue 04 Jan 2011 11:58

Hello,

1. You cannot establish a connection to the database in UDF. Please describe the situation when you need to establish connection in UDF, because UDF already has access to the database.
2. I cannot reproduce the problem. To help you I need the code of the stored procedure and UDF. But it will be better if you compose a small sample to demonstrate the problem and send it to andreyz*devart*com.

stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

Post by stevel » Tue 04 Jan 2011 18:48

Thank you, Andrey. I just wanted to know that it is not possible.

Post Reply