Subject Re: Silly but necessary question
Author deanfranks
--- In firebird-support@yahoogroups.com, "Daniel Jimenez"
<d.jimenez@c...> wrote:
> Hi,
>
> Ok, here it goes. Is there someway to cross references between
tables on
> different DB, i.e. I have the need to write constraints that rely
on tables
> on different DB's
>
> Thank you
>
> danieL
>
> ____________________________
> Comvision Pty. Ltd.
>
> www.comvision.net.au

Daniel,

If you are feeling like an adventure, you could write a UDF that
connected to the second database using IBX. You would pass the
fields in the local database associated with the contraint to the
UDF, and it would check the constraint against the second (or third,
etc) database and return a boolean.

There is a learning curve associated with writing a UDF, and you
would probably have to pass everything by descripter (to handle
nulls in your UDF), but they can be written pretty quickly in Delphi.

If you do follow this route be very careful about error handling in
your UDF, you can easily take out the entire server from a bad UDF.
You will also probably want to keep the connection to the second
database open inside the UDF dll to avoid the overhead of all the
connects.

Dean