Subject | Re: [firebird-support] Insert without referential constraints |
---|---|
Author | Martijn Tonies |
Post date | 2004-03-15T22:53:49Z |
Guys guys...
database? Then why not drop the FKs to start with?
--
Martijn
> One way to get around it, if you are not already doing it, is to allowNULLs
> in one of the foreign keys, make your inserts with a Null, keeping trackof
> the ids, then do an update on the fields that you inserted NULLs into, allAre we trying to figure out ways to get inconsistent data into the
> within a transaction so it would all get undone if anything failed.
database? Then why not drop the FKs to start with?
--
Martijn
> RegardsSQL
> Colin
>
> -----Original Message-----
> From: Martijn Tonies [mailto:m.tonies@...]
> Sent: Monday, 15 March 2004 9:49 p.m.
> To: firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Insert without referential constraints
>
> Hi,
>
> > Is it possible to insert a bunch of records related to each other via
> > foreign keys without worrying about the order of inserts?
> >
> > I've heard that with some databases it's possible to set up a
> > transaction so that referential constraints are checked only at the
> > end of the transaction. Is something like this possible with Firebird
> > also?
>
> These constraints are called "deferred constraints", something which
> Firebird doesn't (yet) support.
>
> It also doesn't support turning constraints OFF.
>
> > Or would the only option be dropping the constraints before inserts
> > and creating them again after?
>
> That's the only way.
>
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL & MS
> Server.
> Upscene Productions
> http://www.upscene.com