473,465 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Create 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 2834
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.ibm.com> wrote in message news:<bo**********@hanover.torolab.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.com> wrote in message
news:c8**************************@posting.google.c om...
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
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
8
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, ......
1
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...
1
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...
13
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
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...
6
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...
20
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...
1
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...
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...
1
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
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...

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.