Unix Technical Forum

How to switch off constraints?

This is a discussion on How to switch off constraints? within the Informix forums, part of the Database Server Software category; --> Hi, IMHO there is a command to switch off constraints for the purpose of import and so on. Anybody ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:02 PM
Joachim Engel
 
Posts: n/a
Default How to switch off constraints?

Hi,

IMHO there is a command to switch off constraints
for the purpose of import and so on.

Anybody can help me?

We are using IDS 7.31.


Kind regards
Joachim Engel.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 08:02 PM
Fernando Nunes
 
Posts: n/a
Default Re: How to switch off constraints?

Joachim Engel wrote:
> Hi,
>
> IMHO there is a command to switch off constraints
> for the purpose of import and so on.
>
> Anybody can help me?
>
> We are using IDS 7.31.
>


Yes.
Check your SQL Syntax Guide.
Something like "SET CONSTRAINTS FOR table DISABLED" (??)

But please remember that re-enabling them can take very long (the engine will have to check them as if it was the first time).

Regards.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 08:02 PM
Art S. Kagel
 
Posts: n/a
Default Re: How to switch off constraints?

On Tue, 07 Oct 2003 11:48:27 -0400, Joachim Engel wrote:

Rather than disable the constraints which would require rechecking the entire
hierarchy of rows, try suspending the constraint checks for the rows
added/updated until the end of the transaction:

begin work;
set constraints all deferred;
---work
commit work; -- All constraint checking of inserted/updated/deleted rows
happens now with an error and forced rollback if the constraints fail.

Art S. Kagel

> Hi,
>
> IMHO there is a command to switch off constraints for the purpose of import
> and so on.
>
> Anybody can help me?
>
> We are using IDS 7.31.
>
>
> Kind regards
> Joachim Engel.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 08:04 PM
Joachim Engel
 
Posts: n/a
Default Re: How to switch off constraints?

Thanx for the infos, guys.

It seems that there is no global switch for the whole database.
We want to import data without considering the order of
Master-Detail relationships.

Kind regards
Joachim Engel


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 08:05 PM
Art S. Kagel
 
Posts: n/a
Default Re: How to switch off constraints?

On Fri, 10 Oct 2003 07:16:59 -0400, Joachim Engel wrote:

That's exactly what the 'set constraints all deferred;' is for, as I detailed
in my last.

Art S. Kagel

> Thanx for the infos, guys.
>
> It seems that there is no global switch for the whole database. We want to
> import data without considering the order of Master-Detail relationships.
>
> Kind regards
> Joachim Engel

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com