Re: [sqlite] Performance question

2006-09-22 Thread Gerald Dachs
> But If I do "select data from pictures where (x between high_x and low_x)
> and (y between high_y and low_y) then this takes ca. 8 seconds (!) on
> wince.

My sql knowledge may be a little bit rusty and I have really no idea how
sqlite is doing "between" querys. Anyway, once I have learned never to use
between because your query is equivalent to:

where ((x >= high_x and x <= low_x) or (x >= low_x and x <= high_x) and
 (y >= high_y and y <= low_y) or (y >= low_y and y <= high_y))

because of the or operators you will get a union of 4 selects.
Maybe I am wrong but I would expect that "where x >= low_x and x <= high_x
and
y >= low_y and y <= high_y" should be faster and all what you need. You have
indices on x and y, haven't you?

Gerald


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Error: file is encrypted or is not a database

2006-09-12 Thread Gerald Dachs
On Tue, 12 Sep 2006 14:29:12 -0400
<[EMAIL PROTECTED]> wrote:

>  files on your computer and this database file accidently got snagged?>
> 
> Thanks, but this application resides on a PDA and my customer is
> reporting this issue on several PDA's. No search/replace operations are
> being performed at a file level on these devices.

They didn't open the database file with something like pocketword and an
auto correction has done its work?

Gerald

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] reading BLOB - Segmentation fault

2006-08-02 Thread Gerald Dachs
> This is not realy for this forum, but maybe somebody can tell me what I am
> doing wrong. I am using CppSQLite wrapper.
>
> Code 1 : With this code "Segmentation fault"
>
> const unsigned char* putBLOBInBinary(CppSQLite3DB , int ) {
> CppSQLite3Query q;
> CppSQLite3Binary blobGet;
>
> q=db.execQuery("select data from bindata where id=1;");
> if (!q.eof()) {
> blobGet.setEncoded((unsigned char*)q.fieldValue("data"));
> lengthBLOB= blobGet.getBinaryLength();
> cout<<"Retrieved binary Length: "< }
> return blobGet.getBinary();
> }
>
> function call from main()
> const unsigned char* pBufferOut;
> pBufferOut = putBLOBInBinary(db, lengthBLOB);
>
> Code 2 : With this code is ok (if I dont use function)
> CppSQLite3Query q;
> CppSQLite3Binary blobGet;
>
> q=db.execQuery("select data from bindata where id=1;");
> if (!q.eof()) {
> blobGet.setEncoded((unsigned char*)q.fieldValue("data"));
> lengthBLOB= blobGet.getBinaryLength();
> cout<<"Retrieved binary Length: "< }
> pBufferOut=blobGet.getBinary();
>
> sorry if this is off topic,

This is completely off topic, it is a simple programming error, I am sure.
Your lengthBLOB outside of the function is fishy, you didn't show even
how and where you have declared it. Your example proofs that not the call to
blobGet.getBinaryLength() is the problem, but the assignment to
lengthBLOB, and lengthBLOB is a reference, to what?

Gerald

Gerald



Re: [sqlite] SQLIte doesn't seem to support SQL properly

2005-11-04 Thread Gerald Dachs
I don't understand how this belongs to the thread "Request for comment: 
Proposed SQLite API changes".

Gerald

On Fri, 4 Nov 2005 20:20:12 +0100
Marco Bambini <[EMAIL PROTECTED]> wrote:

> If table_A has mutiple rows (say like)
> 
>   column1 column2
>   1   B
>   2   H
>   3   R
>   4   Q
>   5   V
> 
> And table_B has
> 
>   column1 column2
>   B
>   R
>   3   H
>   Q
>   5   V
> 
> 
> If I do
>   
>   select column1 from table_A
> 
> I get
>   1
>   2
>   3
>   4
>   5
> 
> But if I do
>   SELECT * FROM TABLE_B where column1 = ( select column1 from table_A )
> 
> I get an empty set (which is good)
> 
> If I do
>   update TABLE_B set column1 = ( select column1 from table_A )
> 
> I expexct to get an error since "select column1 from table_a" is  
> multivalued
> But I dont. The update succeeds as though I wrote "update TABLE_B set  
> column1 = ( select column1 from table_A returning 1 row )" or something
> Table_B is updated with the first result from the subselect.
> 
> Table_B now has
> 
>   column1 column2
>   1   B
>   1   R
>   1   H
>   1   Q
>   1   V
> 
> And now if I do
>   SELECT * FROM TABLE_B where column1 = ( select column1 from table_A )
> 
> I get all rows in table_B which again seems wrong since the subselect  
> IS multivalued
> 
> It would make sense that the select worked if I wrote
>   SELECT * FROM TABLE_B where column1 IN ( select column1 from table_A )
> 
> Any idea?
> 
> ---
> Marco Bambini
> 
> 


Re: AW: [sqlite] and , or

2005-10-18 Thread Gerald Dachs
> Hi,
>
> I want to select the records which have both columns Text and Comming
> empty.
>
> I have found that the problem is the column name "Text".
> If I replace the column name "Text" by another all works fine.
> So I wonder : is "Text" a keyword for sqlite ?

Why do you wonder? You used it yourself as keyword when you declared "text"
as type text.

Gerald



Re: [sqlite] and , or

2005-10-18 Thread Gerald Dachs
>
> Hi sqlite-users
>
> Works fine : select Id from Data where ( ( Text = '' ) or ( Comming = ''
> ) )
> But NOT: select Id from Data where ( ( Text = '' ) and ( Comming '' )
> )

What about this: select Id from Data where ( ( Text = '' ) and ( Comming =
'' ))

Gerald



Re: [sqlite] Upcoming Conferences

2005-10-10 Thread Gerald Dachs
>
>
> --- [EMAIL PROTECTED] wrote:
>
>> "Gerald Dachs" <[EMAIL PROTECTED]> wrote:
>> > > 2005-11-08 Frankfort, Germany
>> >
>> > I guess you mean Frankfurt ;). Be aware that the are two cities in
>> Germany
>> > that are named Frankfurt. I expect that the Conference will be in
>> Frankfurt
>> > am Main and not in Frankfurt an der Oder.
>> >
>>
>> Yes.  I appologize for the misspelling.  And, No, I was not
>> aware of the second Frankfurt.  Frankfurt am Main is the only
>> one I had ever heard of.
>
> How about "Sidney" then? We're offended too! :)

Sorry, but I was not offended, I am from Hamburg I don't care about
Frankfurt. I wanted to prevent only that D. Richard Hipp is using the
wrong
plane :).

Gerald

Gerald



Re: [sqlite] Upcoming Conferences

2005-10-10 Thread Gerald Dachs
> 2005-11-08 Frankfort, Germany

I guess you mean Frankfurt ;). Be aware that the are two cities in Germany
that are named Frankfurt. I expect that the Conference will be in Frankfurt
am Main and not in Frankfurt an der Oder.

Gerald



Re: [sqlite] problem of creation of a data base

2005-07-28 Thread Gerald Dachs
> I tested with:
>
> extern "C"
> {
> #include 
> }
>
> but I always have the following error:
>
> ZeroLink: unknown symbol '__Z21sqlite3OsFullPathnamePKc'
>
> What to make?

I have expected that the definition is in sqlite3.h, what is not
the case. Try it with "os.h".

Anway, I believe that already my first mail should have shown
you the way to go.

Gerald



Re: [sqlite] problem of creation of a data base

2005-07-28 Thread Gerald Dachs
> I added:
>
> extern "C"
> {
> #include 
> }

I wrote this in the moment when the loudspeakers at the walls
told us all to leave the building, because of a technical problem.

> and I have a problem of compilation:
>
> sqlite.h: No such file or directory
>
>
> I tested with:
>
> extern "C"
> {
> #include 
> }

So there is no need to complain because of an obvious mistake.

Gerald



Re: [sqlite] problem of creation of a data base

2005-07-28 Thread Gerald Dachs
> Hello,
>
> I receive this error:
>
> ZeroLink: unknown symbol '__Z21sqlite3OsFullPathnamePKc'
>
> Why?

name mangling, use:

extern "C" {
#include 
}

Gerald



Re: [sqlite] make fails on Solaris

2005-07-15 Thread Gerald Dachs
> Hi,
> 
> Could someone please shed some light what I should do?
> I've got the following errors.  
> 
> Thank you,
> Isarin
> 
> gums-sun% make 
> ./libtool --mode=compile gcc -g -O2 -DOS_UNIX=1 -DHAVE_USLEEP=1 -I.
> -I../sqlite-3.2.2/src -DNDEBUG -DSQLITE_OM\
> IT_CURSOR -c ../sqlite-3.2.2/src/alter.c 
> mkdir .libs 
>  gcc -g -O2 -DOS_UNIX=1 -DHAVE_USLEEP=1 -I. -I../sqlite-3.2.2/src
> -DNDEBUG -DSQLITE_OMIT_CURSOR -c ../sqlite-3\
> .2.2/src/alter.c  -fPIC -DPIC -o .libs/alter.o 
> ../sqlite-3.2.2/src/alter.c: In function `reloadTableSchema': 
> ../sqlite-3.2.2/src/alter.c:220: `OP_DropTrigger' undeclared (first

the file opcodes.h is missing or broken. This header file is made by awk from 
parse.h.
I can't imagine there is a unix system that doesn't have an awk installed.
Does parse.h exist? If not, parse.h and parse.c is made from parse.y by
lemon. Lemon should have been build before you got this error message.
Does lemon exist in the sqlite build directory?

Gerald


Re: [sqlite] Re: Index not used with "between"

2005-04-08 Thread Gerald Dachs
> Hmm... nobody has an answer? Or did my message get eaten by a spam filter
> :(
>
> On Apr 4, 2005 8:02 PM, Cory Nelson <[EMAIL PROTECTED]> wrote:
>> Using the following:
>>
>> create table t_history(time real, ...);
>> create index i_time on t_history(time);
>> select count(*) from t_history where time between
>> julianday('2004-04-01','utc') and julianday('now');
>>
>> It seems the index is never hit.  When using >= and <=, the index
>> works.  Is there a reason between can't use it?

I don't know how sqlite does it, but most sql databases I know translate
 'a between b and c' to '(b <= a and a <= c) or (c <= a and a <= b)'.
That means you would need a reverse index too and you would have to merge
the results. I don't know of a sql optimizer that can solve this, but
maybe somebody knows more.

Gerald



Re: [sqlite] Version 3.1.6

2005-03-17 Thread Gerald Dachs
On Thu, 17 Mar 2005 06:56:04 -0500
"D. Richard Hipp" <[EMAIL PROTECTED]> wrote:

> On Thu, 2005-03-17 at 12:39 +0100, Gerald Dachs wrote:
> > Why do you not use my patch? Do you not agree that this is a bug?
> > 
> 
> No I do not.  The arch.png image is no longer used in the
> documentation. It was replaced by arch2.gif some time ago.
> 
> > 'make doc' on linux is still broken, attached patch for 3.1.3 still
> > works.
> > 
> 
> The makefile works fine when I run it without your patch.

Sorry, noticed only now that bug was at least in 3.1.3, 3.1.4, but has
gone in 3.1.5. Because I didn't get answers on my posts, I assumed
wrongly that, if the patch applies, then the bug is still there.

Sorry again, will be quiet in future.

Gerald


Re: [sqlite] Version 3.1.6

2005-03-17 Thread Gerald Dachs
Why do you not use my patch? Do you not agree that this is a bug?

'make doc' on linux is still broken, attached patch for 3.1.3 still
works.

Gerald

--- sqlite-3.1.3/Makefile.in.orig   2005-03-07 22:56:04.833954328
+0100 +++ sqlite-3.1.3/Makefile.in2005-03-07 22:56:41.189427456
+0100 @@ -451,6 +451,9 @@
 arch.html: $(TOP)/www/arch.tcl
tclsh $(TOP)/www/arch.tcl >arch.html

+arch.png:  $(TOP)/www/arch.png
+   cp $(TOP)/www/arch.png .
+
 arch2.gif: $(TOP)/www/arch2.gif
cp $(TOP)/www/arch2.gif .



Re: [sqlite] Version 3.1.5

2005-03-11 Thread Gerald Dachs
On Fri, 11 Mar 2005 13:07:40 -0500
"D. Richard Hipp" <[EMAIL PROTECTED]> wrote:

> Version 3.1.5 is now available on the website.  This release
> fixes a typo in the previous release that caused problems
> for OS-X users.
> -- 
> D. Richard Hipp <[EMAIL PROTECTED]>
> 

'make doc' on linux is still broken, attached patch for 3.1.3 still
works.

Gerald

--- sqlite-3.1.3/Makefile.in.orig   2005-03-07 22:56:04.833954328
+0100 +++ sqlite-3.1.3/Makefile.in2005-03-07 22:56:41.189427456
+0100 @@ -451,6 +451,9 @@
 arch.html: $(TOP)/www/arch.tcl
tclsh $(TOP)/www/arch.tcl >arch.html

+arch.png:  $(TOP)/www/arch.png
+   cp $(TOP)/www/arch.png .
+
 arch2.gif: $(TOP)/www/arch2.gif
cp $(TOP)/www/arch2.gif .




Re: [sqlite] Version 3.1.4

2005-03-11 Thread Gerald Dachs
> SQLite version 3.1.4 is now available on the website.
> http://www.sqlite.org/
>

'make doc' on linux is still broken, attached patch for 3.1.3 still
works.

Gerald

--- sqlite-3.1.3/Makefile.in.orig   2005-03-07 22:56:04.833954328 +0100
+++ sqlite-3.1.3/Makefile.in2005-03-07 22:56:41.189427456 +0100
@@ -451,6 +451,9 @@
 arch.html: $(TOP)/www/arch.tcl
tclsh $(TOP)/www/arch.tcl >arch.html

+arch.png:  $(TOP)/www/arch.png
+   cp $(TOP)/www/arch.png .
+
 arch2.gif: $(TOP)/www/arch2.gif
cp $(TOP)/www/arch2.gif .




Re: FW: [sqlite] patch for sqlite 3.1.3 to let 'make doc' work

2005-03-07 Thread Gerald Dachs
On Mon, 7 Mar 2005 17:30:07 -0500 
"Griggs, Donald" <[EMAIL PROTECTED]> wrote:

> Hi Gerald,
> 
> I don't think attachments are allowed on the list.

Thank you, I noticed it only now.

>   You may want to check
> the contributions section of the wiki, or perhaps the version tracking
> system.

I prefere email, everything else is too much work ;). The patch
is very small so you will find it at the end of this mail.
 
> Also, you might want to let folks know what operating system you're
> talking about, since there are several.

The patch is for linux.

Gerald

--- sqlite-3.1.3/Makefile.in.orig   2005-03-07 22:56:04.833954328 +0100
+++ sqlite-3.1.3/Makefile.in2005-03-07 22:56:41.189427456 +0100
@@ -451,6 +451,9 @@
 arch.html: $(TOP)/www/arch.tcl
tclsh $(TOP)/www/arch.tcl >arch.html
 
+arch.png:  $(TOP)/www/arch.png
+   cp $(TOP)/www/arch.png .
+
 arch2.gif: $(TOP)/www/arch2.gif
cp $(TOP)/www/arch2.gif .