473,769 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL0632N. Why can't a child table be related to multiple parents on multiple FK columns with the on delete set null option?

There are 2 tables A and B with A being the parent of B.

Table A
(
Col1 varchar(5) Not Null
)

Table B
(
B_PK varchar(5) Not Null ,
B1 varchar(5) ,
B2 varchar(5)
)

Basically what we want to do was if any A.Col1 is deleted and there
are matching B1 or B2, set them to null for those records.

I know if we use 'on delete' with rules other than 'SET NULL', it
would be fine. But what is wrong with setting any related FK values to
null when its corresponding PK is deleted??

D:\DBA\LDS>db2 create table A (Col1 varchar(5) not null)
DB20000I The SQL command completed successfully.

D:\DBA\LDS>db2 alter table A add primary key (col1)
DB20000I The SQL command completed successfully.

D:\DBA\LDS>db2 create table B (B_PK varchar(5) not null, B1
varchar(5), B2 varchar(5))
DB20000I The SQL command completed successfully.

D:\DBA\LDS>db2 alter table B add primary key (B_PK)
DB20000I The SQL command completed successfully.

D:\DBA\LDS>db2 alter table B add foreign key (B1) references A on
delete set null
DB20000I The SQL command completed successfully.

D:\DBA\LDS>db2 alter table B add foreign key (B2) references A on
delete set null
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0632N FOREIGN KEY "B2..." is not valid because the table cannot be
defined
as a dependent of table "LDSDEV.A" because of delete rule restrictions
(reason
code = "3"). SQLSTATE=42915
Nov 12 '05 #1
3 2872
What product and what version? DB2 for Linux/Unix/Windows added support
for what you're trying to do in Fixpack 3 of Version 8.1

Regards,
Miro
Nov 12 '05 #2
We are running DB2 v8.1.1.0, fixpak 0 on AIX v5. I'll see if we could
put FixPak3 on the server, which has Websphere stuffs on it ...
Thanks.

DB21085I Instance "ldsdbdev" uses "32" bits and DB2 code release
"SQL08010"
with level identifier "01010106".
Informational tokens are "DB2 v8.1.1.0", "s021023", "", and FixPak
"0".
Product is installed at "/usr/opt/db2_08_01".
miro flasza <mi**@torolab.i bm.com> wrote in message news:<bo******* ***@hanover.tor olab.ibm.com>.. .
What product and what version? DB2 for Linux/Unix/Windows added support
for what you're trying to do in Fixpack 3 of Version 8.1

Regards,
Miro

Nov 12 '05 #3
"sql-db2-dba" <le****@aptea.c om> wrote in message
news:c8******** *************** ***@posting.goo gle.com...
We are running DB2 v8.1.1.0, fixpak 0 on AIX v5. I'll see if we could
put FixPak3 on the server, which has Websphere stuffs on it ...
Thanks.

Base code with no fixpaks is very buggy. Fixpak 4 is expected soon.
Nov 12 '05 #4

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

Similar topics

4
5778
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
8
7493
by: jim | last post by:
I have two tables that are related by keys. For instance, Table employee { last_name char(40) not null, first_name char(40) not null, department_name char(40) not null, age int not null, ... } Employee table has a primary key (combination of last_name and first_name).
1
1947
by: GGerard | last post by:
Hello I am working with Access 2000 I have two tables joined on a one to many relationship between two fields: Table1:FieldID (one) is joined to Table2:FieldMyID (many) Field Properties setting: FieldID : Field Size - Long Integer New Values - Increment
1
1463
by: Mr Newbie | last post by:
Sorry to bother you guys but I have another questions related to DataSets. I'm almost there now, so I dont expect to bug you much more ( Hopefully ). I have Master / Details tables with cascading relationships between them. When I Update the master using the DataAdapter we get a new ID for the new master row and all the child row foreign keys are updated to the newly aquired ID.
13
51645
by: Tibor | last post by:
I am using PostgreSQL 7.4.1 (only through psql) I know, that the command ALTER TABLE OFFICES DROP PRIMARY KEY (CITY); and its foreign key equivalent: ALTER TABLE SALESREPS DROP CONSTRAINT
0
8566
by: Innova | last post by:
Hi, We are working on a gridview inside the gridview (parent-child) scenario. The data of child grid will depend on the data of parent. Objectives: 1.Add new row in parent grid after each row and add child grid into that row because the columns in child grid are same as parent grid and we want to align them with the cols of parent grid. 2. If there is data for child grid we show a plus image in the parent row (in the row above the...
6
3858
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called "Generations"), and it allows the user to add, edit and delete the various records of the table. "Generations" table has the following fields: "IDPerson", NamePerson", "AgePerson" and "IDParent". A record contains the information about a person (his name, his...
20
2959
omerbutt
by: omerbutt | last post by:
hi there i am making an application in which i have to populate columns that consist of some textfields and some input boxes the problem is at the mozilla's end, it creates a new node and appends the new created or child node to the parent node it is working fine to the point of addition in the Explorer And Mozzila but when it comes to deleting the column it still works perfect in explorer without any javascript or other error but when i try to...
1
3474
by: bytesFTW99 | last post by:
I have been struggling with this for some time can anyone help out? just trying to have 3 dropdown boxes that fill depending on what is selected, then in some cases click a button and have the second set of 3 dropdown boxes be filled with the same values. thank you <head> <SCRIPT LANGUAGE="JavaScript" type="text/javascript"> var firstChoice2 = 0; var secondChoice2 = 0;
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10206
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
10035
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
9984
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
9851
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
8863
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...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2811
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.