Re: conditional insert operations

David Raymond <[email protected]>
Newsgroups gmane.comp.db.sqlite.general
Message-ID <VI1PR07MB60292D8EB1F35162771CA50C87040@VI1PR07MB6029.eurprd07.prod.outlook.com>
I'm not quite following what you're trying to do here. Could you provide a few examples of "here's what used to be in there", "here's what I want to insert", "here's what it should like in the end"



-----Original Message-----
From: sqlite-users <[email protected]> On Behalf Of Peng Yu
Sent: Thursday, January 30, 2020 11:27 AM
To: SQLite mailing list <[email protected]>
Subject: [sqlite] conditional insert operations

Hi,

Suppose that I have a table with three columns h1, h2, v. I want to
delete all rows with h1=a, and insert rows like the following (data
shown in TSV format), only if there is not an entry with h1=a and
h2="" (empty), it exists but its v is not equal to a value X.

a,A,v1
a,B,v2
...

https://www.sqlite.org/lang_insert.html

I am not sure if there is a way to check an entry to know whether new
entries can be inserted. Could anybody show me an example if this can
be done?

-- 
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.