Subject | Re: Silly but necessary question |
---|---|
Author | deanfranks |
Post date | 2004-10-26T12:17:21Z |
--- In firebird-support@yahoogroups.com, "Daniel Jimenez"
<d.jimenez@c...> wrote:
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
<d.jimenez@c...> wrote:
> Hi,tables on
>
> Ok, here it goes. Is there someway to cross references between
> different DB, i.e. I have the need to write constraints that relyon tables
> on different DB'sDaniel,
>
> Thank you
>
> danieL
>
> ____________________________
> Comvision Pty. Ltd.
>
> www.comvision.net.au
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