cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Syntax ??

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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