1

I am geocoding several addresses but unfortunately I receive null values in the mySQL database that happens to break my script. I would like to allow null values in my database so I can fix the addresses manually afterwards. Is it possible to allow my current columns to allow null values without breaking my existing records?

The warning I see is: Error! SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'coord_lat' cannot be null

image

enter image description here

Machavity
  • 30,841
  • 27
  • 92
  • 100
chronotrigga
  • 589
  • 1
  • 10
  • 33

2 Answers2

2

Update the column to allow null values (modify the below to suit your needs):

ALTER TABLE mytable MODIFY mycolumn VARCHAR(255); 

(stolen from How do I modify a MySQL column to allow NULL?)

Community
  • 1
  • 1
barbiepylon
  • 891
  • 7
  • 23
1

Alter table and remove null integrity constraint on coord_lat column.

Zereges
  • 5,139
  • 1
  • 25
  • 49