Subject Re: [IB-Architect] Proxy Query ?
Author Doug Chamberlin
At 3/6/2001 06:21 AM (Tuesday), darko_prenosil@... wrote:
>Is it possible to write UDF (exetended stored proc) that opens
>another database, runs query across that database and return the
>result back to IB ? Is there problem by accessing IB back-end engine
>again from UDF ? It will be ideal to return cursor or complete result
>set !
>For example sybase support proxy table that is similar to this idea,
>and MsSql does not have problems to access more databases at all.

No, you do not want to follow this plan.

While it may be possible to do something like this it would be extremely
difficult and ultimately unreliable. UDF's were not designed for this type
of work. Some problems which come to mind: 1) The UDF call provides no
context to the function. 2) The UDF processing has no associated
transaction context. 3) The UDF processing stalls the server while it is
happening. 4) The UDF function would have to re-connect to the database to
provide data to it. How does it know how to do this?

This question has been asked and answered before. You might want to check
the newsgroup archive at for a more complete response.

A better design might be to have another process running on the server (or
another server) which maintains an open connection to the database and
responds to event alerts. When this processing is needed the event is
triggered. The waiting process responds by doing the processing and adding
the results to the Interbase database.

What exactly is the problem you are trying to solve?