[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread R.Smith
On 2015-09-15 06:01 PM, Nicolas J?ger wrote: > hi Keith, hi others, > >> If there should only be one entry for each name (and it is not case >> sensitive), > I'm using sqlite trough a C++ program wich take care of the case > sensitive. In this very case, each entry has to be unique. Fine, but

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread Nicolas Jäger
Hi people! @Ryan, > Fine, but do think of if you ever might want to use the DB via > anything else, or a DB admin program... best is to ensure the DB > schema itself knows the collation and case sensitivity requirements.

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread Simon Slavin
On 15 Sep 2015, at 5:01pm, Nicolas J?ger wrote: > I also would like to know how can I check if an entry exists,(or not > exists), in a table. Like, > > IF (exists) THEN (doSomething) END Here's another alternative to add to those in Ryan's excellent post. With your schema > create table

[sqlite] sqlite3 file as database

2015-09-15 Thread Simon Slavin
On 15 Sep 2015, at 1:16pm, John McKown wrote: > Like the "resource fork" on the older MacOS systems? I think that OS/2 also > has "extended attributes"(?) which could be set. > https://en.wikipedia.org/wiki/Extended_file_attributes Resource forks were intended for content rather than

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread Igor Tandetnik
On 9/15/2015 2:04 PM, John McKown wrote: > sqlite> select count(a) from x; Better still: select exists (select 1 from x); The difference is that the version with count() always scans the whole table, while the latter stops at the first record - which is good enough if you only need to check

[sqlite] New Delphi SQLite data access components

2015-09-15 Thread Denis Yanov
Devart company released new SQLite Delphi data access components named LiteDAC 2.6. List of improvements and fixes: - RAD Studio 10 Seattle is supported - INSERT, UPDATE and DELETE batch operations are supported - Now Trial for Win64 is a fully functional Professional Edition - Now at

[sqlite] New SQLite dbExpress driver

2015-09-15 Thread Denis Yanov
Devart team is proud to introduce the new version of Devart dbExpress driver for SQLite including such significant features as: - RAD Studio 10 Seattle is supported and now you can use the latest IDE to develop cross-platform applications. - Now the trial limitation by 6 columns is removed

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread John McKown
Very good! I'll keep that one. On Tue, Sep 15, 2015 at 1:26 PM, Igor Tandetnik wrote: > On 9/15/2015 2:04 PM, John McKown wrote: > >> sqlite> select count(a) from x; >> > > Better still: > > select exists (select 1 from x); > > The difference is that the version with count() always scans the

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread John McKown
On Tue, Sep 15, 2015 at 12:43 PM, Simon Slavin wrote: > > On 15 Sep 2015, at 5:01pm, Nicolas J?ger wrote: > > > I also would like to know how can I check if an entry exists,(or not > > exists), in a table. Like, > > > > IF (exists) THEN (doSomething) END > > Here's another alternative to add to

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread Nicolas Jäger
hi Keith, hi others, > If there should only be one entry for each name (and it is not case > sensitive), I'm using sqlite trough a C++ program wich take care of the case sensitive. In this very case, each entry has to be unique. > your best bet would be to declare that NAME is unique: > >

[sqlite] sqlite3 file as database

2015-09-15 Thread John McKown
Like the "resource fork" on the older MacOS systems? I think that OS/2 also has "extended attributes"(?) which could be set. https://en.wikipedia.org/wiki/Extended_file_attributes > In OS/2 version 1.2 and later, the High Performance File System

[sqlite] sqlite3 file as database

2015-09-15 Thread Jean-Christophe Deschamps
At 01:07 15/09/2015, you wrote: >--- >SQUISH was a database format for storing messages in FidoNet systems. >--- Geez, I don't even recall my FidoNet node number aka address... Time must have flown by faster than I thought. -- jcd

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-15 Thread R.Smith
On 2015-09-14 09:04 PM, Petr L?z?ovsk? wrote: > Have following table: > > CREATE TABLE ip_addr > ( > /*! Person identificator (PID) %%a */ pid INTEGER PRIMARY KEY NOT NULL, > /*! IP address %%b */ ip_addr VARCHAR (16) NOT NULL, > /*! Status: 0 - Allowed, Unassigned to specific customer (blocked)

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-15 Thread Petr Lázňovský
Thay track all of us and "optimalise" search results. My list of links could differ from yours. I have googled key phrase '"UNIQUE constraint failed:" sqlite primary key' and similar, but not read whole received documents, perform only brief look on it. This is best practice by my experience,

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread Nicolas Jäger
hi, I have a table TAGS with idkey and two colums (NAME, COUNT): id|NAME|COUNT 53|black metal|3 55|occult rock|3 61|satanic smurfs|1 62|beer|0 63|pizza|0 I want to check if some tag exist by checking if `NAME` is recorded in the table or not. If not, I want to add it; INSERT INTO TAGS ( NAME,

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread Nicolas Jäger
hi, I have a table TAGS with idkey and two colums (NAME, COUNT): id|NAME|COUNT 53|black metal|3 55|occult rock|3 61|satanic smurfs|1 62|beer|0 63|pizza|0 I want to check if some tag exist by checking if `NAME` is recorded in the table or not. If not, I want to add it; INSERT INTO TAGS ( NAME,