Re: [sqlite] How do I insert a record in an SQLite table only if the row does not already exist?

2017-12-21 Thread R Smith
On 2017/12/21 1:56 PM, Patrick Skelton wrote: Hi, I am wanting to create an 'atomic' SQL script that will insert a record into a table only if the supplied record's primary key does not already exist, thus avoiding the constraint exception that occurs if the insert goes ahead. I have the

[sqlite] How do I insert a record in an SQLite table only if the row does not already exist?

2017-12-21 Thread Patrick Skelton
Hi, I am wanting to create an 'atomic' SQL script that will insert a record into a table only if the supplied record's primary key does not already exist, thus avoiding the constraint exception that occurs if the insert goes ahead. I have the following script which is wrong. I get an error