am using sqlite3 database. I have inserted set of device_ids(unique) in a table called device, this is done when the table is empty. But when i try to insert the ids again which contains some new id's it is throwing error because of uniqueness.
device_all_id.each do |device_id|
insert into device (Device_id) values ('#{device_id.first}') where where Device_id <> '#{device_id.first}'
end
So i want to check whether the record is already there before inserting device_ids, so i tried 'IF EXISTS' query but that too throwing as syntax error.
could anyone please help me out of this..