Re: [sqlite] Is there an optimization for "IS NULL" operator in a SELECT query ?

2010-02-27 Thread Jay A. Kreibich
On Sun, Feb 28, 2010 at 01:26:20AM +0100, Kees Nuyt scratched on the wall: > On Sun, 28 Feb 2010 00:44:00 +0100, "Artur Reilin" > wrote: > > > "Select count(id) from table where text!='' or > > text!=NULL" is the same, right? > > text!=NULL is not a valid expression. Sure

Re: [sqlite] Is there an optimization for "IS NULL" operator in a SELECT query ?

2010-02-27 Thread Jean-Christophe Deschamps
>It is driving me crazy. I'm working on a web spider where a table >holds the downloaded >webpage. It seems that a select > >"SELECT count(*) WHERE NOT text IS NULL" > >requires that the complete text column is loaded. With a stored LOB >this results in crazy performance. > >Is this optimized in

Re: [sqlite] Is there an optimization for "IS NULL" operator in a SELECT query ?

2010-02-27 Thread Kees Nuyt
On Sun, 28 Feb 2010 00:44:00 +0100, "Artur Reilin" wrote: > "Select count(id) from table where text!='' or > text!=NULL" is the same, right? text!=NULL is not a valid expression. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing

Re: [sqlite] Is there an optimization for "IS NULL" operator in a SELECT query ?

2010-02-27 Thread Lothar Scholz
Hello Artur, Sunday, February 28, 2010, 12:44:00 AM, you wrote: AR> "Select count(id) from table where text!='' or text!=NULL" is the same, AR> right? Using text!='' obviously needs to load the text column. I just tried it nevertheless and aborted after 5 min (brute force reread of the whole

Re: [sqlite] Is there an optimization for "IS NULL" operator in a SELECT query ?

2010-02-27 Thread Artur Reilin
"Select count(id) from table where text!='' or text!=NULL" is the same, right? As i see you want to count all rows, right? I don't know if it is faster to only count one column instead of *, but I using it the one-column-count way. Perhaps this helps too? Artur --- Am 28.02.2010,

[sqlite] Is there an optimization for "IS NULL" operator in a SELECT query ?

2010-02-27 Thread Lothar Scholz
It is driving me crazy. I'm working on a web spider where a table holds the downloaded webpage. It seems that a select "SELECT count(*) WHERE NOT text IS NULL" requires that the complete text column is loaded. With a stored LOB this results in crazy performance. Is this optimized in later

Re: [sqlite] Retrieving column names

2010-02-27 Thread Kees Nuyt
On Sat, 27 Feb 2010 13:46:28 -0500, "ve3meo" wrote: >Is there a way to use SELECT against the PRAGMA result-set? > >This returns an error: >SELECT * FROM (PRAGMA table_info(tablename)); With the command line tool, you can: sqlite> create table pti( ...>

[sqlite] structure question

2010-02-27 Thread Francisco Azevedo
Hi all, I want to create a "publish/undo system" for some tables but i don't know what is the best approach to do it. Imagine i have a table with columns id (auto-inc), data (text) then i want to edit table data (eg: create 2 new rows now, delete one tomorrow, update 3 rows tomorow too) and

Re: [sqlite] What's the problem with my INSERT clause?

2010-02-27 Thread senglory
Oops, my INSERT started working as soon as I removed some lines before it in SQLIte Expert. And you solution works as well. Thanks. BTW, can you recommend me suitable UI to work with SQLite? Igor Tandetnik wrote: > > senglory wrote: >> insert into tb_appointment(GroupCalendarID, ObjectID,

Re: [sqlite] What's the problem with my INSERT clause?

2010-02-27 Thread Mark Brand
> insert into tb_appointment(GroupCalendarID, ObjectID, Subject) values( > ( > select ugc.GroupCalendarID > from TB_User_GroupCalendar ugc > join TB_User u on u.objectID = ugc.UserID > join TB_GroupCalendar gc on gc.ObjectID = ugc.GroupCalendarID > where calendarname='DEFAULT CALENDAR FOR ' ||

Re: [sqlite] What's the problem with my INSERT clause?

2010-02-27 Thread Igor Tandetnik
senglory wrote: > insert into tb_appointment(GroupCalendarID, ObjectID, Subject) values( > ( > select ugc.GroupCalendarID > from TB_User_GroupCalendar ugc > join TB_User u on u.objectID = ugc.UserID > join TB_GroupCalendar gc on gc.ObjectID = ugc.GroupCalendarID > where calendarname='DEFAULT

[sqlite] What's the problem with my INSERT clause?

2010-02-27 Thread senglory
insert into tb_appointment(GroupCalendarID, ObjectID, Subject) values( ( select ugc.GroupCalendarID from TB_User_GroupCalendar ugc join TB_User u on u.objectID = ugc.UserID join TB_GroupCalendar gc on gc.ObjectID = ugc.GroupCalendarID where calendarname='DEFAULT CALENDAR FOR ' || u.Username ),

Re: [sqlite] Retrieving column names

2010-02-27 Thread Matthew Smith
In Tcl, the following command will give you a list of column names of table. set sStuff [lindex [db1 eval " pragma table_info($sTable)" {lappend sNameList $name}] 0] -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of ve3meo

Re: [sqlite] Retrieving column names

2010-02-27 Thread ve3meo
"P Kishor" wrote in message news:cdf6db501002270448s2d28ef4fm9a831fdfa7bf3...@mail.gmail.com... > On Sat, Feb 27, 2010 at 6:43 AM, Peter Rodwell > wrote: >> I'm sure this question has been asked and answered a million times, but >> I've not been able

Re: [sqlite] Retrieving column names

2010-02-27 Thread P Kishor
On Sat, Feb 27, 2010 at 6:43 AM, Peter Rodwell wrote: > I'm sure this question has been asked and answered a million times, but I've > not been able > to find the answer. Googling for it has turned up lots of answers, none of > which seem to > work with SQLite:

[sqlite] Retrieving column names

2010-02-27 Thread Peter Rodwell
I'm sure this question has been asked and answered a million times, but I've not been able to find the answer. Googling for it has turned up lots of answers, none of which seem to work with SQLite: Given the SQLite databse "mydb" containing table "mytable", what is the correct SQL command to

Re: [sqlite] C++ API

2010-02-27 Thread Jay A. Kreibich
On Sat, Feb 27, 2010 at 09:55:07AM +0100, eternelmangekyosharingan scratched on the wall: > Let's assume you need to insert a small number of rows in a given table > using the C++ API. > Is it recommended to use the one-step query execution interface function > sqlite3_exec over the

[sqlite] accessing file change counter in api

2010-02-27 Thread Max Vlasov
I did some search and as I see, file change counter (dbFileVers field of the header) is not directly or indirectly accessible for reading. But sometimes one would like to have such feature. For example, every layer above sqlite has likely its own cache (Delphi db engine for example). And having

[sqlite] C++ API

2010-02-27 Thread eternelmangekyosharingan
Hi, Let's assume you need to insert a small number of rows in a given table using the C++ API. Is it recommended to use the one-step query execution interface function sqlite3_exec over the pre-compiled statement interface functions sqlite3_prepare_v2, sqlite3_bind_int, ..., sqlite3_step ? Is