Hello Everybody !
 
I have to update a table bspos set stauftragsstammid after a correcting
a corrupt table stauftragsstamm
 
table stauftragsstamm (stauftragsstammid primary key, stnlstammid,
auftragsnr,...)
table bspos(bsposid primary
key,stnlstammid,stauftragsstammid,auftragsnr,.......)
 
This statement works on our test database(same structure as produktion
database):
update bspos set stauftragsstammid = (select stauftragsstammid from
stauftragsstamm where stauftragsstamm.auftragsnr = bspos.auftragsnr and
stauftragsstamm.stnlstammid = bspos.stnlstammid)
 
With the same statement on our production database i get an error:
 
---- Error -------------------------------
Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
 General error;300 POS(1) Integrity
violation:STAUFTRAGSSTAMMID,BSPOS,BWALLE
 
There are no known foreign keys defined on both tables!? (no foreign
keys,no constrains are shown when looking at the table definition with
sql-studio)
The combination stauftragsstamm.stnlstammid,stauftragsstamm.auftragsnr
in stauftragsstamm is unique !
select distinct stnlstammid,auftragsnr from stauftragsstamm gives the
same result as select count(*) from stauftragsstamm

 
bwalle is a usergroup! Both tables belong to this usergroup! 
 
What is wrong ?????????
Any help welcomed

Best regards 

Albert Beermann 

                              ''''' 
                             ''''''''' 
                            (0 0) 
 +---------oOO-----------(_)------------------------------+ 
 | Tel: 0541/5841-868                                  | 
 | Fax: 0541/5841-869                                 | 
 | Mail: mailto:[EMAIL PROTECTED]  |  
 | Internet:  http://www.piepenbrock.de <http://www.piepenbrock.de/>
| 
 +--------------------------------------oOO----------------+ 
                          |__|__| 
                            ||  || 
                        ooO Ooo 

 

Reply via email to