on 02-04-2008 1:36 PM
Hello Everybody!
SQL for dummies ???
I have 2 maxdb tables
STadressstamm with 160000 records adressidnr,name1,name2,plz,strasse,ort,bundesland (bundesland is empty)
STplzbundesland with 26000 records plzidnr,plz,bundesland
Now i want to update the empty column bundesland in stadressstamm with the correct bundesland from stplzbundesland.
I tried : update stadressstamm set bundesland = (select bundesland from stplzbundesland where stplzbundesland.plz = stadresstamm.plz)
General error;300 POS(1) Integrity violation:BUNDESLAND,STADRESSSTAMM
Can someone help me with the correct maxdb syntax for this update?
Best regards
Albert
Hi,
your update-syntax seems to be correct.
Error 300 is no syntax-error, but one which is returned, if a new value for a column does not fulfil the restrictions defined for that column.
The question therefore is: Which kind of constraint is defined for column bundesland in table STADRESSSTAMM? And if you know this, then please check (select) the values in the stplzbundesland.bundesland-column NOT fulfilling that constraint. They should be changed, the constraint should be changed or (in case of NOT NULL) some missing rows should be included in stplzbundesland.
To find missing rows a
select plz from STADRESSSTAMM
except
select plz from stplzbundesland
will show those plz, which are missing in stplzbundesland.
Hope, this helps
Elke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.