473,776 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Turn On/Off Foreign Key Constraints?

AK
My understanding is that unlike CHAEK and FOREIGN KEY constraints, we
cannot have UNIQUE ones NOT ENFORCED, and the reason is very simple:
UNIQUE constraints are implemented as UNIQUE indexes. One cannot turn
off uniquenedss of an index easily

Am I correct?
Nov 12 '05 #1
2 2970
AK wrote:
My understanding is that unlike CHAEK and FOREIGN KEY constraints, we
cannot have UNIQUE ones NOT ENFORCED, and the reason is very simple:
UNIQUE constraints are implemented as UNIQUE indexes. One cannot turn
off uniquenedss of an index easily

Am I correct?

That is correct. DB2 could allow informational uniqueness. Nothing
speaks against it.
That would imply some tweaking of the catalogs though or we'd end up
with informational idedxes which is a tad weird for my taste at least.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #2
AK
Serge,

thank you for answering!
Nov 12 '05 #3

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

Similar topics

3
3867
by: D | last post by:
Database 1 is corrupted. Database 2 was created by dba but none of the primary or foreign key constraints were ported over. TOAD won't let me export. I will try ErWin next. What is the best way to recover this information if the views are corrupted and through errors? thanks, Lowly developer
0
5293
by: John Towell | last post by:
------=_NextPart_000_0008_01C360DD.C2475700 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit We are trying to load a set of data using Hibernate (O/R mapping tool). Hibernate creates foreign key constraints when it is creating our DB (mysql 4.0.14). The process for loading data requires us to break these constraints at certain points, however they will all be satisfied at the end of the transaction.
3
2128
by: bk3 | last post by:
I'm having a bit of a problem creating foreign keys on a MySQL database. The tables create and everything seems to be fine. But I just wanted to test out adding a row to one of the child tables without having anything in the parent table and it lets me insert the row, which it shouldn't obviously. How do i create it so that the constraints work? Thanks, Bill Here is my create table code:
0
1418
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A stored procedure updates a row in C, adds a row each in B & C. I get an integrity violation. All the foreign keys are deferrable, and the stored procedure is called from within a transaction with constraints deferred. (And the foreign keys do refer to...
6
2812
by: Brendan Jurd | last post by:
Hi all, I read on the manual page for Inheritance that: "A limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single tables, not to their inheritance children. Thus, in the above example, specifying that another table's column REFERENCES cities(name) would allow the other table to contain city names but not capital names. This deficiency will probably be fixed...
13
3702
by: Bob Stearns | last post by:
Why is the following constraint invalid? I want to make sure that every row in IS3.ANIMALS_PRIV_INDEXES matches one of those in IS3.table_var_defn with part of the primary key fixed. Since this is illegal with the following message, how do I achieve this result? The last thing below is a working constraint from another table. ALTER TABLE IS3.ANIMALS_PRIV_INDEXES ADD CONSTRAINT FOREIGN KEY(3, variable_id) REFERENCES...
0
1908
by: Rajesh Tiwari | last post by:
Hi Group, i have a foreign key in a table in sql server.i am using a dataset and populating it with the contents of this table.my problem is that i am not able to access the foreign key that i cretaed on this table in the database.i am using a code something like this.if i check the number of constraints on the table it prints 1,which is nothing but the primary key constraint on this table,why doesn't it print 2 and show both primary and...
8
3537
by: wespvp | last post by:
I am using PostgreSQL 7.4.1 on RedHat 7.2. The query I am executing is something like (I replaced all the return values with 'count'): db=> explain select count(*) from messages m join (select * from message_recipients r join addresses a on a.Address_Key=r.Recipient where a.Address='lra.edi@edi.cma-cgm.com') as foo on (m.Message_Key=foo.Message_Key AND (m.Message_Date >= '29-MAR-04') AND (m.Message_Date <= '31-MAR-04...
0
2160
by: okonita | last post by:
DB2v8.2 LUW. Unable to drop Foreign Key constraints...although DROP constraints returns undefined name. Am I missing somrthing here? Hi all, I have a perplexing DB2 Drop command situation. Environment I have tried severally to drop Foreign Key constraints on a set of tables and each time I get a SQL0204N "SQL071030104307060" is an undefined name. ". However, when I go back to look at the table or load data, I get a constraint error...
0
10289
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.