Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sqlite Database Error duplicate column name

Error Code : 1 (SQLITE_ERROR) Caused By : SQL(query) error or missing database.
    (duplicate column name: Floor (code 1)
while compiling: 
CREATE TABLE LocalizationInfo(_item INTEGER PRIMARY KEY, idINT,Floor TEXT, Floor HeightTEXT, Adress TEXT ,LatitudeTEXT, LongitudeTEXT, Altitude TEXT,Pressure TEXT) 

I tried to save my data i.e. Floor,Floor height, GPS data and Adress which was obtained from another activity to another which implements the SQLite data for saving,loading,editting and deletion. I am always receiving this error message when i try to add the data from the other activity to the database by clicking the list or post button which directs the user to the database.

like image 587
Dan Matthew Lucas Avatar asked Dec 03 '25 13:12

Dan Matthew Lucas


2 Answers

try not to put space between Floor Height, if you want you can do _ ie. Floor_Height TEXT

like image 159
jonrizz Avatar answered Dec 05 '25 07:12

jonrizz


I think your problem caused by using whitespace for your colum name Floor Height. It would be good idea that you should use underscore instead of whitespace for column names. You can define your column names like floor, floor_height, gps_data and address.

like image 30
S.Grain Avatar answered Dec 05 '25 08:12

S.Grain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!