Re: [sqlite] Sql update script. check for existing rows before inserting...

2020-02-23 Thread R.Smith
Send-before-checking failure. :) Corrections to my previous mail: 1. "... is to check in my code if the table exists" must read: "... is to check in my code if the table is empty" 2. "...ON CONFLICT DO UPDATESET (Antenna..." must read: "...ON CONFLICT DO UPDATE  SET (Antenna..."

Re: [sqlite] Sql update script. check for existing rows before inserting...

2020-02-23 Thread R.Smith
On 2020/02/24 06:17, Andy KU7T wrote: Hi, I would like to write a script that checks whether certain records already exist, and if not, insert them. If they do exist, it should be a no op. I am trying this: IF (SELECT COUNT(*) FROM [Antennas]) = 0 BEGIN /* Table data [Antennas] Record

Re: [sqlite] Sql update script. check for existing rows before inserting...

2020-02-23 Thread Keith Medcalf
On >Behalf Of Andy KU7T >Sent: Sunday, 23 February, 2020 21:17 >To: SQLite mailing list >Subject: [sqlite] Sql update script. check for existing rows before >inserting... > >Hi, > >I would like to write a script that checks whether certain records >already exist, and

[sqlite] Sql update script. check for existing rows before inserting...

2020-02-23 Thread Andy KU7T
Hi, I would like to write a script that checks whether certain records already exist, and if not, insert them. If they do exist, it should be a no op. I am trying this: IF (SELECT COUNT(*) FROM [Antennas]) = 0 BEGIN /* Table data [Antennas] Record count: 16 */ INSERT OR REPLACE INTO