Phil,

How is it that you are able to insert more than one row with a TASK_ID
value equal to 1?  You said that you declared TASK_ID to be the primary
key.  If that's the case, DB2 should create a unique index on that column
and reject any attempts to insert more than one record with TASK_ID = 1,
yet, if I'm interpreting you correctly, you say that you inserted four rows
having the value 1 for TASK_ID.

Could you be more explicit about exactly how you defined these tables and
any RI (i.e. post the DDL)?

Steve Westfall
Equifax, Inc.



                                                                                       
                                          
                    "Philip Nelson                                                     
                                          
                    (DBA)"                To:     [EMAIL PROTECTED]                       
                                          
                    <teamdba@attgl        cc:     [EMAIL PROTECTED]                   
                                          
                    obal.net>             Subject:     [DB2EUG] Unexpected RI Result : 
is this normal                            
                    Sent by:                                                           
                                          
                    owner-db2eug@l                                                     
                                          
                    ugwash.org                                                         
                                          
                                                                                       
                                          
                                                                                       
                                          
                    03/26/2002                                                         
                                          
                    01:28 PM                                                           
                                          
                    Please respond                                                     
                                          
                    to "Philip                                                         
                                          
                    Nelson (DBA)"                                                      
                                          
                                                                                       
                                          
                                                                                       
                                          



DB2 V7.2 on Linux

I create a table -

T0010STOCK_MARKET_DATA

with primary key (EXCHANGE_SYMBOL, SECURITY_SYMBOL);

Created another table -

T0020TASK

with primary key (TASK_ID)

and the fields EXCHANGE_SYMBOL and SECURITY_SYMBOL as nullable fields
(since every task does not apply to a specific security).

Now am able to insert the following records -

(TASK_ID, EXCHANGE_SYMBOL, SECURITY_SYMBOL)
1,NULL,NULL   (I expect this to work)
1,'US','MSFT' (again I'd expect this)
1, '1', 'MSFT' (this fails : I'd expect that)
1, '1', NULL (didn't expect this)
1, NULL, '1') (or this)

So if either of the fields is NULL it allows the insert to proceed.

Is this correct ?

Phil Nelson
ScotDB Limited

-
:::  When replying to the list, please use 'Reply-All' and make sure
:::  a copy goes to the list ([EMAIL PROTECTED]).
***  To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
***  For more information, check http://www.db2eug.uni.cc

Reply via email to