473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Deferring constraints in DB2

Hi,

I have a problem with deffering constraints with db2. It was explained
five year ago at this same group
(http://groups.google.pl/groups?hl=pl...m%26rnum%3D4):

"I have DB2 v 6.1, fixpak 3 and following problem:
On Oracle I can create foreign key constraints DEFERRABLE
INITIALLY
DEFERRED or I can SET CONSTRAINTS ALL DEFERRED

On informix I can SET CONSTRAINTS ALL DEFERRED too.

In both cases, when transaction commits, all the constraints will
be
checked.

Can I do this on DB2?
I've tried SET INTEGRITY FOR table OFF, but this will set table
in the
check pending state, and I cannot SELCT or UPDATE the table.

SET INTEGRITY FOR table FOREIGN KEY IMMEDIATE UNCHECKED
should defer integrity checking, but it doesn't seem to work. The
constraint is still checked.

Even if it would work, do I have to SET INTEGRITY FOR table
IMMEDIATE
CHECKED explicitly before transaction commit?"

Mr Serge Rielau (sr*****@ca.ibm.com) wrote anwer:

"DB2 currently doesn't support this feature." ;)

My question is: if DB2 v.8.2. still doesn't support this feature?

Regards,
Mark.
Nov 12 '05 #1
3 6028
Marek Berkan wrote:
Hi,

I have a problem with deffering constraints with db2. It was explained
five year ago at this same group
(http://groups.google.pl/groups?hl=pl...m%26rnum%3D4):
"I have DB2 v 6.1, fixpak 3 and following problem:
On Oracle I can create foreign key constraints DEFERRABLE
INITIALLY
DEFERRED or I can SET CONSTRAINTS ALL DEFERRED

On informix I can SET CONSTRAINTS ALL DEFERRED too.

In both cases, when transaction commits, all the constraints will
be
checked.

Can I do this on DB2?
I've tried SET INTEGRITY FOR table OFF, but this will set table
in the
check pending state, and I cannot SELCT or UPDATE the table.

SET INTEGRITY FOR table FOREIGN KEY IMMEDIATE UNCHECKED
should defer integrity checking, but it doesn't seem to work. The
constraint is still checked.

Even if it would work, do I have to SET INTEGRITY FOR table
IMMEDIATE
CHECKED explicitly before transaction commit?"

Mr Serge Rielau (sr*****@ca.ibm.com) wrote anwer:

"DB2 currently doesn't support this feature." ;)

My question is: if DB2 v.8.2. still doesn't support this feature?

Regards,
Mark.

No changes on that front. It's still a known requirement.
What you can do is is toggle enforcement of the constraint using ALTER
TABLE. Note that this switch is NOT session level. When you toggle back
to enforced DB2 will verify integrity on the table.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
Hi,

Serge Rielau napisał(a):
No changes on that front. It's still a known requirement.
What you can do is is toggle enforcement of the constraint using ALTER
TABLE. Note that this switch is NOT session level. When you toggle back
to enforced DB2 will verify integrity on the table.


Thank you for your answer. So, this method is good for administration
tasks but is not acceptable in "normal" application :(

Regards,
Mark.
Nov 12 '05 #3
Marek Berkan wrote:
Hi,

Serge Rielau napisał(a):
No changes on that front. It's still a known requirement.
What you can do is is toggle enforcement of the constraint using ALTER
TABLE. Note that this switch is NOT session level. When you toggle
back to enforced DB2 will verify integrity on the table.

Thank you for your answer. So, this method is good for administration
tasks but is not acceptable in "normal" application :(

Regards,
Mark.

Correct - unless you run "uncommited read" isolation to begin with, in
which case you are already in fuzzy land to begin with.
That's why I stated it's _still_ a requirement.
Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul | last post by:
Hi: I am not sure whether somebody can sort it out for me. I am doing data transfer from one oracle database to another. Both of them has the same structure (like same tables etc).the only...
0
by: Rajesh Kapur | last post by:
We use InnoDB tables and foreign key constraints extensively. The mysqldump backs up the database tables in alphabetical order with foreign key constraints defined in the create statement of each...
1
by: Robin Tucker | last post by:
I'm considering adding domain integrity checks to some of my database table items. How does adding such constraints affect SQL Server performance? For example, I have a simple constraint that...
4
by: Dmitri | last post by:
I just looked at a coworker's stored procedure and this person is dropping 4 Foreign key constraints and then re-adding them after processing the required logic (updating rows in the 4 tables in...
2
by: DW | last post by:
Greetings: I have to do a one-off forceful change of some data in a database. I need to disable some FK constraints, make the data change, and then re-enable the constraints. My process will...
10
by: serge | last post by:
I am doing a little research on Google about this topic and I ran into this thread: ...
0
by: Oleg Lebedev | last post by:
Hi, I need to know if there is a way to defer or disable a unique index on a table during an update. One way would be to set indisunique to false, perform update and then set to true. But, this...
0
by: BobTheDatabaseBoy | last post by:
i've Googled some this morning, but to my surprise, i don't find any offering (for fee or open source), which would integrate with, say Jakarta Struts, to provide the UI edits from cataloged...
4
by: Bobby Edward | last post by:
I have an xsd dataset. I created a simple query called GetDataByUserId. I can preview the data fine! I created a very simple BLL function that calls it and returns a datatable. When I run...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.