[sqlite] [2.8.x] Incrementing a column automatically with INSERT/UPDATE?

2007-08-03 Thread Gilles Ganault

Hello

	I was wondering if SQLite 2.8.x was able to update a column automatically 
when performing either INSERT or UPDATE, or if this can only be done with 
triggers in 3.x?


For instance, when adding a record, I need to have a counter in the third 
column be incremented by one:


insert into mytable values (NULL,'bart',counter= counter+1)

Thank you
G.


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



Re: [sqlite] building 3.4.1

2007-08-03 Thread Victor Secarin

The lock4-1.3 problem happens ONLY when lock4.test is run after lock3.test:
=
[EMAIL PROTECTED] arcturus | sqlite.arcturus.gcc > ./testfixture 
../sqlite/test/lock4.test

lock4-1.1... Ok
lock4-1.2... Ok
lock4-1.3... Ok
lock4-999.1... Ok
Memory leaked: 0 bytes in 0 allocations

Thread-specific data deallocated properly
0 errors out of 5 tests
Failures on these tests:

[EMAIL PROTECTED] arcturus | sqlite.arcturus.gcc > ./testfixture 
../sqlite/test/lock3.test && ./testfixture ../sqlite/test/lock4.test

lock3-1.1... Ok
lock3-2.1... Ok
lock3-3.1... Ok
lock3-3.2... Ok
lock3-3.3... Ok
lock3-4.1... Ok
lock3-4.2... Ok
lock3-4.3... Ok
Memory leaked: 0 bytes in 0 allocations

Thread-specific data deallocated properly
0 errors out of 9 tests
Failures on these tests:
lock4-1.1... Ok
lock4-1.2... Ok
lock4-1.3...
Error: database is locked
lock4-999.1... Ok
Memory leaked: 0 bytes in 0 allocations

Thread-specific data deallocated properly
1 errors out of 5 tests
Failures on these tests: lock4-1.3
=
Victor Secarin

Joe Wilson wrote:
The string "integer value too large to represent" is not found in 
sqlite sources, so I assume it is an error in either in Tcl or the tcl 
test harness.


I have no idea why the checksum of the databases in malloc2-1.1.28.5
is different, or whether it is harmless.

As for the malloc2.1.5 failure, as far as I can tell looking at the test, 
an empty abc table should be present.


I have no idea about lock4-1.3.

I'd suggest to make a ticket for each of these test errors.

  http://www.sqlite.org/cvstrac/tktnew

--- Victor Secarin <[EMAIL PROTECTED]> wrote:
  
Here are the fulltest errors I get trying to build sqlite 3.4.1 with the 
included gcc on Enterprise 3, 4 and Fedora 5.
After building tcl8.4.7 and installing it in /usr/local, I was able to 
configure with "--with-tcl=/usr/local/lib" and build the two libraries 
completely and then run the fulltest on Enterprise 3 as well.
I hope someone will find these useful and will be able to tell me to 
what extent the builds may be used or not.
Meanwhile, I will redo these builds, wit the Intel 9.1.052 compiler this 
time, and I will post the fulltest results.

Please advise, and thank you very much,
Victor Secarin


A. Fulltest on Fedora 5 (64 bits) with glibc-2.4-11/gcc-4.1.1:
===
3 errors out of 240587 tests
Failures on these tests: lock4-1.3 malloc2-1.1.28.5 malloc2.1.5

lock4-1.3...
Error: database is locked
malloc2-1.1.28.5...
Expected: [7150405b58e993f161c43b93edd13553]
 Got: [bc598bca7e7514b7f36e3e3d178a97ba]
malloc2.1.5...
Error: no such table: abc

B. Fulltest on RedHat Enterprise 4 update 5 (64 bits) with 
glibc-2.3.4-2.36/gcc-3.4.4:


2 errors out of 127702 tests
Failures on these tests: printf-8.1 printf-8.2

printf-8.1...
Error: integer value too large to represent
printf-8.2...
Error: integer value too large to represent


C. Fulltest on Enterprise 3  update 9 (64 bits) with 
glibc-2.3.2-95.50/gcc-3.2.3:

===
2 errors out of 127702 tests
Failures on these tests: printf-8.1 printf-8.2

printf-8.1...
Error: integer value too large to represent
printf-8.2...
Error: integer value too large to represent


D. Fulltest on Enterprise 3  update 9 (32 bits) with 
glibc-2.3.2-95.50/gcc-3.2.3:


3 errors out of 110199 tests
Failures on these tests: lock4-1.3 malloc2-1.1.34.5 malloc2.1.5

lock4-1.3...
Error: database is locked
malloc2-1.1.34.5...
Expected: [7150405b58e993f161c43b93edd13553]
 Got: [bc598bca7e7514b7f36e3e3d178a97ba]
malloc2.1.5...
Error: no such table: abc


please advise, and thank you very much,
Victor Secarin


Joe Wilson wrote:


Can you post the output for the failed tests?

i.e.:

 footest-13.1...
 Expected: [10]
  Got: [0]

--- Victor Secarin <[EMAIL PROTECTED]> wrote:
  
  
Hello, everyone. I just started to look at the software and I have two 
questions:



Question 1:

Building sqlite-3.4.1, as obtained from the cvs, on Fedora 5, 64 bits, 
with gcc 4.1.1, over glibc-2.4-11, and tcl/tcl-devel 8.4.13-1.1,

followed by "make fulltest", I get the following three failed tests:

lock4-1.3  malloc2-1.1.31.5  malloc2.1.5


Building the same with the Intel compiler icc 9.1.051, I get 8 failures 
as follows:


bind-4.4  bind-4.5  expr-2.26  malloc2.1.5  printf-13.6  utf16-bind-4.4  
utf16-bind-4.5  utf16-expr-2.26
  




   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 


--

Re: [sqlite] building 3.4.1

2007-08-03 Thread Joe Wilson
The string "integer value too large to represent" is not found in 
sqlite sources, so I assume it is an error in either in Tcl or the tcl 
test harness.

I have no idea why the checksum of the databases in malloc2-1.1.28.5
is different, or whether it is harmless.

As for the malloc2.1.5 failure, as far as I can tell looking at the test, 
an empty abc table should be present.

I have no idea about lock4-1.3.

I'd suggest to make a ticket for each of these test errors.

  http://www.sqlite.org/cvstrac/tktnew

--- Victor Secarin <[EMAIL PROTECTED]> wrote:
> Here are the fulltest errors I get trying to build sqlite 3.4.1 with the 
> included gcc on Enterprise 3, 4 and Fedora 5.
> After building tcl8.4.7 and installing it in /usr/local, I was able to 
> configure with "--with-tcl=/usr/local/lib" and build the two libraries 
> completely and then run the fulltest on Enterprise 3 as well.
> I hope someone will find these useful and will be able to tell me to 
> what extent the builds may be used or not.
> Meanwhile, I will redo these builds, wit the Intel 9.1.052 compiler this 
> time, and I will post the fulltest results.
> Please advise, and thank you very much,
> Victor Secarin
> 
> 
> A. Fulltest on Fedora 5 (64 bits) with glibc-2.4-11/gcc-4.1.1:
> ===
> 3 errors out of 240587 tests
> Failures on these tests: lock4-1.3 malloc2-1.1.28.5 malloc2.1.5
> 
> lock4-1.3...
> Error: database is locked
> malloc2-1.1.28.5...
> Expected: [7150405b58e993f161c43b93edd13553]
>  Got: [bc598bca7e7514b7f36e3e3d178a97ba]
> malloc2.1.5...
> Error: no such table: abc
> 
> B. Fulltest on RedHat Enterprise 4 update 5 (64 bits) with 
> glibc-2.3.4-2.36/gcc-3.4.4:
> 
> 2 errors out of 127702 tests
> Failures on these tests: printf-8.1 printf-8.2
> 
> printf-8.1...
> Error: integer value too large to represent
> printf-8.2...
> Error: integer value too large to represent
> 
> 
> C. Fulltest on Enterprise 3  update 9 (64 bits) with 
> glibc-2.3.2-95.50/gcc-3.2.3:
> ===
> 2 errors out of 127702 tests
> Failures on these tests: printf-8.1 printf-8.2
> 
> printf-8.1...
> Error: integer value too large to represent
> printf-8.2...
> Error: integer value too large to represent
> 
> 
> D. Fulltest on Enterprise 3  update 9 (32 bits) with 
> glibc-2.3.2-95.50/gcc-3.2.3:
> 
> 3 errors out of 110199 tests
> Failures on these tests: lock4-1.3 malloc2-1.1.34.5 malloc2.1.5
> 
> lock4-1.3...
> Error: database is locked
> malloc2-1.1.34.5...
> Expected: [7150405b58e993f161c43b93edd13553]
>  Got: [bc598bca7e7514b7f36e3e3d178a97ba]
> malloc2.1.5...
> Error: no such table: abc
> 
> 
> please advise, and thank you very much,
> Victor Secarin
> 
> 
> Joe Wilson wrote:
> > Can you post the output for the failed tests?
> >
> > i.e.:
> >
> >  footest-13.1...
> >  Expected: [10]
> >   Got: [0]
> >
> > --- Victor Secarin <[EMAIL PROTECTED]> wrote:
> >   
> >> Hello, everyone. I just started to look at the software and I have two 
> >> questions:
> >> 
> >>> Question 1:
> >>> 
> >>> Building sqlite-3.4.1, as obtained from the cvs, on Fedora 5, 64 bits, 
> >>> with gcc 4.1.1, over glibc-2.4-11, and tcl/tcl-devel 8.4.13-1.1,
> >>> followed by "make fulltest", I get the following three failed tests:
> >>>
> >>> lock4-1.3  malloc2-1.1.31.5  malloc2.1.5
> >>>
> >>>
> >>> Building the same with the Intel compiler icc 9.1.051, I get 8 failures 
> >>> as follows:
> >>>
> >>> bind-4.4  bind-4.5  expr-2.26  malloc2.1.5  printf-13.6  utf16-bind-4.4  
> >>> utf16-bind-4.5  utf16-expr-2.26



   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
 

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



Re: [sqlite] ltrime() and rtrim() not understood with ODBC?

2007-08-03 Thread Mitchell Vincent
Ahh, that's it.
On the ODBC driver information page I see "So far it has been tested
with SQLite 2.8.17 and SQLite 3.3.13"

Darn!

Thanks Joe!

On 8/3/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
> rtrim was introduced on 17-Mar-07, and was in the sqlite 3.3.14 release.
>
>   http://www.sqlite.org/cvstrac/chngview?cn=3698
>
> What sqlite version is your ODBC driver?
>
>   select sqlite_version();
>
> --- Mitchell Vincent <[EMAIL PROTECTED]> wrote:
> > If I use sqlite3.exe to execute the query "Select
> > customer_id,customer_number FROM customers where customer_number !=
> > rtrim(customer_number);" it works great but as soon as I run that
> > query through using the SQLite ODBC driver (using the latest
> > available) I get "no such function: rtrim (1)"
> >
> > I thought at first that maybe sqlite3.exe just had extra extension
> > functions compiled in but http://www.sqlite.org/lang_expr.html says
> > ltrim and rtrim are "core".
> >
> > Is there something I have to do to get ltrim/rtrim to work over ODBC?
>
>
>
>
> 
> Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
> today's economy) at Yahoo! Games.
> http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>


-- 
- Mitchell Vincent
- K Software - Innovative Software Solutions
- Visit our website and check out our great software!
- http://www.ksoftware.net

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



Re: [sqlite] ltrime() and rtrim() not understood with ODBC?

2007-08-03 Thread Joe Wilson
rtrim was introduced on 17-Mar-07, and was in the sqlite 3.3.14 release.

  http://www.sqlite.org/cvstrac/chngview?cn=3698

What sqlite version is your ODBC driver?

  select sqlite_version();

--- Mitchell Vincent <[EMAIL PROTECTED]> wrote:
> If I use sqlite3.exe to execute the query "Select
> customer_id,customer_number FROM customers where customer_number !=
> rtrim(customer_number);" it works great but as soon as I run that
> query through using the SQLite ODBC driver (using the latest
> available) I get "no such function: rtrim (1)"
> 
> I thought at first that maybe sqlite3.exe just had extra extension
> functions compiled in but http://www.sqlite.org/lang_expr.html says
> ltrim and rtrim are "core".
> 
> Is there something I have to do to get ltrim/rtrim to work over ODBC?



   

Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

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



[sqlite] ltrime() and rtrim() not understood with ODBC?

2007-08-03 Thread Mitchell Vincent
If I use sqlite3.exe to execute the query "Select
customer_id,customer_number FROM customers where customer_number !=
rtrim(customer_number);" it works great but as soon as I run that
query through using the SQLite ODBC driver (using the latest
available) I get "no such function: rtrim (1)"

I thought at first that maybe sqlite3.exe just had extra extension
functions compiled in but http://www.sqlite.org/lang_expr.html says
ltrim and rtrim are "core".

Is there something I have to do to get ltrim/rtrim to work over ODBC?

Thanks!

-- 
- Mitchell Vincent

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



RE: [sqlite] Strange behaviour on Update

2007-08-03 Thread Griggs, Donald


-Original Message-
From: Luís Santos [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 03, 2007 2:41 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Strange behaviour on Update

Hi, Ppl

We have found a strange behaviour on SQLite 3.4.1 (We have also tested against 
versions 3.0.8, 3.2.5 and 3.4.0)

When we create a field with a name composed exclusively of numeric algarisms, 
we cannot perform an update.

We have only noticed this odd behaviour because of a NOT NULL field. See the 
code example:

sqlite> CREATE TABLE test (
   ...>   id INT NOT NULL,
   ...>   FieldOne TEXT NOT NULL,
   ...>   FieldTwo TEXT,
   ...>   "1" TEXT
   ...> );
sqlite> insert into test (id, FieldOne ) values (1, "4");

sqlite> update test set FieldOne ="1";
SQL error: test.FieldOne may not be NULL

Has anybody stumbled upon something like this?

Thnx
Luís Santos
===
===

It works ok for me in 3.4.0 if I use single quotes, i.e.,

 update test set FieldOne ='1'; 


I believe single quotes are correct for character constants, and double quotes 
for column names.
Nonetheless, I think sqlite lets you sneak by in many cases using double quotes 
for constants, but your table has a column named "1".


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



Re: [sqlite] Strange behaviour on Update

2007-08-03 Thread Joe Wilson
update test set FieldOne = '1';

--- Luís Santos <[EMAIL PROTECTED]> wrote:
> sqlite> CREATE TABLE test (
>...>   id INT NOT NULL,
>...>   FieldOne TEXT NOT NULL,
>...>   FieldTwo TEXT,
>...>   "1" TEXT
>...> );
> sqlite> insert into test (id, FieldOne ) values (1, "4");
> 
> sqlite> update test set FieldOne ="1";
> SQL error: test.FieldOne may not be NULL



   

Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

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



[sqlite] Re: Strange behaviour on Update

2007-08-03 Thread Igor Tandetnik

Luís Santos  wrote:

When we create a field with a name composed exclusively of numeric
algarisms, we cannot perform an update.

We have only noticed this odd behaviour because of a NOT NULL field.
See the code example:

   sqlite> CREATE TABLE test (
  ...>   id INT NOT NULL,
  ...>   FieldOne TEXT NOT NULL,
  ...>   FieldTwo TEXT,
  ...>   "1" TEXT
  ...> );
   sqlite> insert into test (id, FieldOne ) values (1, "4");

   sqlite> update test set FieldOne ="1";
   SQL error: test.FieldOne may not be NULL


Seems to work as intended. If the field were named "a" instead of "1", 
your query would be equivalent to


update test set FieldOne = a;

That is, you set one field to have the same value as another filed in 
the same row. But since you haven't inserted a value into column "1", it 
contains NULL. So SQLite complains when you assign NULL to a field 
declared as NOT NULL.


Did you perhaps mean

   update test set FieldOne ='1';

? Do you understand a difference between single and double quotes in SQL 
syntax?


Igor Tandetnik 



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



RE: [sqlite] [VC++ 6] Error compiling VBified source

2007-08-03 Thread Gilles Ganault

At 11:23 03/08/2007 -0700, Robert Simpson wrote:

Download the System.Data.SQLite.DLL I maintain from
http://sqlite.phxsoftware.com


Thanks, I'll check it out :-)

G.


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



Re: [sqlite] Problem with SQLite FastCGI module "malformed database schema"

2007-08-03 Thread Zbigniew Baniewski
On Fri, Aug 03, 2007 at 11:38:57AM -0700, Joe Wilson wrote:

> > Of course I'm not. The PHP4 module uses sqlite2.x, and - besides - it
> 
> :-)
> 
> "Of course"?  That's rich.

"Of course" - just because I haven't any possibility to do that.

> > OK, I'll try to ask maintainers about that.
> 
> Good luck.

Sent a comment about that - we'll see.
-- 
pozdrawiam / regards

Zbigniew Baniewski

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



[sqlite] Strange behaviour on Update

2007-08-03 Thread Luís Santos

Hi, Ppl

We have found a strange behaviour on SQLite 3.4.1 (We have also tested 
against versions 3.0.8, 3.2.5 and 3.4.0)


When we create a field with a name composed exclusively of numeric 
algarisms, we cannot perform an update.


We have only noticed this odd behaviour because of a NOT NULL field. See 
the code example:


   sqlite> CREATE TABLE test (
  ...>   id INT NOT NULL,
  ...>   FieldOne TEXT NOT NULL,
  ...>   FieldTwo TEXT,
  ...>   "1" TEXT
  ...> );
   sqlite> insert into test (id, FieldOne ) values (1, "4");

   sqlite> update test set FieldOne ="1";
   SQL error: test.FieldOne may not be NULL

Has anybody stumbled upon something like this?

Thnx
Luís Santos




Re: [sqlite] Problem with SQLite FastCGI module "malformed database schema"

2007-08-03 Thread Joe Wilson
--- Zbigniew Baniewski <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 03, 2007 at 09:27:22AM -0700, Joe Wilson wrote:
> 
> > You are not checking the return code of the sqlite3 connection close.
> 
> Of course I'm not. The PHP4 module uses sqlite2.x, and - besides - it

:-)

"Of course"?  That's rich.

I don't know whether you're running PHP version 3, 4, 99 or PI^2 and
what version of sqlite it uses.

> OK, I'll try to ask maintainers about that.

Good luck.

I fear I've learned too much about PHP already.


  

Shape Yahoo! in your own image.  Join our Network Research Panel today!   
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



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



Re: [sqlite] SQLite.org needs online forms

2007-08-03 Thread Kees Nuyt
On Fri, 3 Aug 2007 09:35:49 -0400, you wrote:

>Sounds like Wikipedia.  I understand that Wikipedia's software is Open
>Source and available.  Do you know of other Wiki servers that would suffice
>or be more on target?

There are several wiki software packages avaialble. 
The wiki server behind
http://www.sqlite.org/cvstrac/wiki 
is more than adequate for its purpose. 

To answer some of your other questions:
The timeline 
http://www.sqlite.org/cvstrac/timeline 
and bugtracker reports 
http://www.sqlite.org/cvstrac/reportlist 
are informative the way they are. I can't see Sourceforge or
such would improve this.

To me, the (this) mailing list sqlite-users@sqlite.org and its
archives are better than any forum. It's easy enough to instruct
good anti-spam software to respect any mailing lists one is
subscribed to. And just like Andrew I prefer to have all info
pushed to me.
-- 
  (  Kees Nuyt
  )
c[_]

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



RE: [sqlite] [VC++ 6] Error compiling VBified source

2007-08-03 Thread Robert Simpson
> -Original Message-
> From: Gilles Ganault [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 03, 2007 11:12 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] [VC++ 6] Error compiling VBified source
> 
> At 09:53 03/08/2007 -0700, Joe Wilson wrote:
> >This has come up before on the list. The instructions are wrong:
> 
> Sorry, should have thought someone had already tried.. and failed :-/
> 
> Browsing through the archives, it looks like the code might 
> not be 100% 
> reliable, so I'll probably look for another solution to have 
> an up-to-date 
> VB-compatible SQLite DLL.
> 

Download the System.Data.SQLite.DLL I maintain from
http://sqlite.phxsoftware.com

I've "wrapped" all the cdecl SQLite calls with corresponding stdcall
_interop calls and made minor adjustments to them for easier marshaling.
The library was designed to be used from .NET or straight C++, but you can
just as easily use it from VB6.  If using it from a non-dotnet language,
.NET runtimes are not required.  It doesn't statically link to them.

You could also download the source from there and compile just the primary
SQLite amalgamation with my modifications.  The interop.c file will have all
the declarations you need to write your imports in VB.

Robert



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



Re: [sqlite] [VC++ 6] Error compiling VBified source

2007-08-03 Thread Gilles Ganault

At 09:53 03/08/2007 -0700, Joe Wilson wrote:

This has come up before on the list. The instructions are wrong:


Sorry, should have thought someone had already tried.. and failed :-/

Browsing through the archives, it looks like the code might not be 100% 
reliable, so I'll probably look for another solution to have an up-to-date 
VB-compatible SQLite DLL.


Thanks.


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



Re: [sqlite] building 3.4.1, running tests

2007-08-03 Thread Joe Wilson
./testfixture test/select1.test

> Is there a way to run a single test of my choice?



  

Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

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



RE: [sqlite] How to Speed of Inserts

2007-08-03 Thread Robert Simpson
> -Original Message-
> From: Stephen Sutherland [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 03, 2007 10:33 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] How to Speed of Inserts
> 
[snip]
>
>So it makes me a bit concerned that when I have to drop my 
> XML repository with 7,000 to 10,000 records it will take 
> forever at application start up ? 
>
>   Is there a way to execute all these inserts much faster 
> than I am currently doing ? 
>
>   I am currently simply using sqlite3_exec(db, "INSERT SQL 
> STATEMENT ", ... etc etc ) 
>   for every single insert statement. 
>
>   Is there away to maximize this speed dramatically to do 
> 10,000 inserts in less than 5 seconds. 
>


3 words  Transaction Transaction Transaction.  Issue a BEGIN before you
start inserting, and a COMMIT afterwards, and then come back and tell us how
many MILLISECONDS it took.

Robert



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



Re: [sqlite] How to Speed of Inserts

2007-08-03 Thread P Kishor
1. Use bind vars... prepare the statement once, execute it many times
binding values each time.

1a. Drop the index.

2. Use a transaction.

3. Commit every . In your case with only
10,000 recs, I would commit only at the very end.

4. Build the index at the end.

Really, 10k recs should insert in a coupla seconds.

On 8/3/07, Stephen Sutherland <[EMAIL PROTECTED]> wrote:
> Hi
>
>   Here's My Situation:
>   -
>   I have an XML file which contains user created data. It can have maybe 
> 10,000 or more nodes. The XML needs to be queried infrequently for use in the 
> application, in a way that lends itself more to SQL. For example the only 
> query that I will use is
>   "SELECT * FROM myTable WHERE BookID IN 
> (2,3,4,5,7,8,23,24,25,26,27,38,67,66)"
>
>   That's a good example. The IN parameters can vary with numbers ranging form 
> 1 to 66.
>
>   IN COMES SQLITE3
>   ---
>
>   So I decided to pull all the XML nodes into the Sqlite3 databse at 
> application start up.
>
>   But I have discovered some slowness.
>   So far I have simply reused the quick start code.
>
>   I modified it to do the following:
>   1. Open the Database.
>   2. Drop the 2 tables if they exist in the database
>   3. Created 2 tables if not exist -  Lookup_BookID and Question
>   LookupID has a primary key on BookID and Question has no index.
>
>   4. Then I simply insert 66 records into lookup_bookID at application start 
> up.
>   Well simply by inserting 66 3 field records into my LookupID , I count 7 
> seconds.
>
>So it makes me a bit concerned that when I have to drop my XML repository 
> with 7,000 to 10,000 records it will take forever at application start up ?
>
>   Is there a way to execute all these inserts much faster than I am currently 
> doing ?
>
>   I am currently simply using sqlite3_exec(db, "INSERT SQL STATEMENT ", ... 
> etc etc )
>   for every single insert statement.
>
>   Is there away to maximize this speed dramatically to do 10,000 inserts in 
> less than 5 seconds.
>
>
>   Thanks
>
>   Stephen
>
>
> -
> Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links.


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
S&T Policy Fellow, National Academy of Sciences http://www.nas.edu/
-
collaborate, communicate, compete
=

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



RE: [sqlite] How to Speed of Inserts

2007-08-03 Thread Griggs, Donald
 
Regarding:
   
  "Is there away to maximize this speed dramatically ...?"


Yes, be sure to surround your inserts with a single transaction (i.e.,
"BEGIN", "END").

If you were doing millions of inserts, you might want to use a new
transaction after each, say, 5 thousand inserts.

If you don't care about the integrity of your database in the event of a
crash (i.e., you'll just repeat the build from scratch) you might turn
off SYNCHRONOUS with the PRAGMA, but just using the transaction might be
quite sufficient.

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



[sqlite] How to Speed of Inserts

2007-08-03 Thread Stephen Sutherland
Hi
   
  Here's My Situation:
  -
  I have an XML file which contains user created data. It can have maybe 10,000 
or more nodes. The XML needs to be queried infrequently for use in the 
application, in a way that lends itself more to SQL. For example the only query 
that I will use is 
  "SELECT * FROM myTable WHERE BookID IN (2,3,4,5,7,8,23,24,25,26,27,38,67,66)"
   
  That's a good example. The IN parameters can vary with numbers ranging form 1 
to 66.
   
  IN COMES SQLITE3
  ---
   
  So I decided to pull all the XML nodes into the Sqlite3 databse at 
application start up.
   
  But I have discovered some slowness. 
  So far I have simply reused the quick start code.
   
  I modified it to do the following: 
  1. Open the Database.
  2. Drop the 2 tables if they exist in the database
  3. Created 2 tables if not exist -  Lookup_BookID and Question
  LookupID has a primary key on BookID and Question has no index.  
   
  4. Then I simply insert 66 records into lookup_bookID at application start up.
  Well simply by inserting 66 3 field records into my LookupID , I count 7 
seconds. 
   
   So it makes me a bit concerned that when I have to drop my XML repository 
with 7,000 to 10,000 records it will take forever at application start up ? 
   
  Is there a way to execute all these inserts much faster than I am currently 
doing ? 
   
  I am currently simply using sqlite3_exec(db, "INSERT SQL STATEMENT ", ... etc 
etc ) 
  for every single insert statement. 
   
  Is there away to maximize this speed dramatically to do 10,000 inserts in 
less than 5 seconds. 
   
   
  Thanks 
   
  Stephen 

   
-
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links. 

Re: [sqlite] Problem with SQLite FastCGI module "malformed database schema"

2007-08-03 Thread Zbigniew Baniewski
On Fri, Aug 03, 2007 at 09:27:22AM -0700, Joe Wilson wrote:

> You are not checking the return code of the sqlite3 connection close.

Of course I'm not. The PHP4 module uses sqlite2.x, and - besides - it
doesn't return any value when using sqlite_close.

> I have no idea if the PHP sqlite3 wrapper propogates these errors,

No, it isn't.

http://hostprogressive.com/support/php_5_docs/function.sqlite-close.html

void sqlite_close ( resource dbhandle )
!

> as the return code of sqlite3_close is not examined (see PHP wrapper below).
> Perhaps PHP somehow calls sqlite3_errcode() - who knows. It's a question 
> for the PHP people.

OK, I'll try to ask maintainers about that.
-- 
pozdrawiam / regards

Zbigniew Baniewski

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



Re: [sqlite] building 3.4.1, running tests

2007-08-03 Thread Victor Secarin

Is there a way to run a single test of my choice?
Victor Secarin


Joe Wilson wrote:

Can you post the output for the failed tests?

i.e.:

 footest-13.1...
 Expected: [10]
  Got: [0]

--- Victor Secarin <[EMAIL PROTECTED]> wrote:
  
Hello, everyone. I just started to look at the software and I have two 
questions:


Question 1:

Building sqlite-3.4.1, as obtained from the cvs, on Fedora 5, 64 bits, 
with gcc 4.1.1, over glibc-2.4-11, and tcl/tcl-devel 8.4.13-1.1,

followed by "make fulltest", I get the following three failed tests:

lock4-1.3  malloc2-1.1.31.5  malloc2.1.5


Building the same with the Intel compiler icc 9.1.051, I get 8 failures 
as follows:


bind-4.4  bind-4.5  expr-2.26  malloc2.1.5  printf-13.6  utf16-bind-4.4  
utf16-bind-4.5  utf16-expr-2.26



How do I find out which matter and which do not?
Is there a mechanism whereby I can check these without bothering people?
Is the testing machinery documented anywhere?
Am I supposed to use the library if I have failed tests?
  




   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC


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

  


---
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient. Any review, 
use, distribution, or disclosure by others is strictly prohibited. If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.



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



Re: [sqlite] [VC++ 6] Error compiling VBified source

2007-08-03 Thread Joe Wilson
--- Gilles Ganault <[EMAIL PROTECTED]> wrote:
>   As I'd like to be able to build my own SQLite DLL for use with Visual 
> Basic Classic, I followed Todd Tanner's instructions at 
> www.tannertech.net/sqlite3vb/ to make the (few) required changes and 
> compile with Visual C++ 6.0.

This has come up before on the list. The instructions are wrong:

 Comment out the following lines is loadext.c by adding 2 back slashes ("//") 
to the start of the
line. This prevents errors due to our changes.

 sqlite3_changes,
 sqlite3_close,

 sqlite3_last_insert_rowid,
 sqlite3_libversion,
 sqlite3_libversion_number,

 sqlite3_open,
 sqlite3_open16, 

Try to find another compatible sqlite3 driver.

> 
> As a test, after just making those changes in the amalgamated files, I get 
> an error:
> 
> //=sqlite3.h
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> //sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
> sqlite_int64 __stdcall sqlite3_last_insert_rowid(sqlite3 *);
> 
> //=sqlite3.c
> //sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
> sqlite_int64 __stdcall sqlite3_last_insert_rowid(sqlite3*);
> 
> //=Compiling
> => sqlite3_last_insert_rowid,
> error C2152: 'initializing' : pointers to functions with different attributes
> 
> Is it a configuration issue? Actually, I didn't find where in VC++ 6.0 to 
> put the reference to the .DEF file (nothing that looks like Module 
> Definiont File under Linker.)



   

Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

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



Re: [sqlite] building 3.4.1

2007-08-03 Thread Victor Secarin
Here are the fulltest errors I get trying to build sqlite 3.4.1 with the 
included gcc on Enterprise 3, 4 and Fedora 5.
After building tcl8.4.7 and installing it in /usr/local, I was able to 
configure with "--with-tcl=/usr/local/lib" and build the two libraries 
completely and then run the fulltest on Enterprise 3 as well.
I hope someone will find these useful and will be able to tell me to 
what extent the builds may be used or not.
Meanwhile, I will redo these builds, wit the Intel 9.1.052 compiler this 
time, and I will post the fulltest results.

Please advise, and thank you very much,
Victor Secarin


A. Fulltest on Fedora 5 (64 bits) with glibc-2.4-11/gcc-4.1.1:
===
3 errors out of 240587 tests
Failures on these tests: lock4-1.3 malloc2-1.1.28.5 malloc2.1.5

lock4-1.3...
Error: database is locked
malloc2-1.1.28.5...
Expected: [7150405b58e993f161c43b93edd13553]
Got: [bc598bca7e7514b7f36e3e3d178a97ba]
malloc2.1.5...
Error: no such table: abc

B. Fulltest on RedHat Enterprise 4 update 5 (64 bits) with 
glibc-2.3.4-2.36/gcc-3.4.4:


2 errors out of 127702 tests
Failures on these tests: printf-8.1 printf-8.2

printf-8.1...
Error: integer value too large to represent
printf-8.2...
Error: integer value too large to represent


C. Fulltest on Enterprise 3  update 9 (64 bits) with 
glibc-2.3.2-95.50/gcc-3.2.3:

===
2 errors out of 127702 tests
Failures on these tests: printf-8.1 printf-8.2

printf-8.1...
Error: integer value too large to represent
printf-8.2...
Error: integer value too large to represent


D. Fulltest on Enterprise 3  update 9 (32 bits) with 
glibc-2.3.2-95.50/gcc-3.2.3:


3 errors out of 110199 tests
Failures on these tests: lock4-1.3 malloc2-1.1.34.5 malloc2.1.5

lock4-1.3...
Error: database is locked
malloc2-1.1.34.5...
Expected: [7150405b58e993f161c43b93edd13553]
Got: [bc598bca7e7514b7f36e3e3d178a97ba]
malloc2.1.5...
Error: no such table: abc


please advise, and thank you very much,
Victor Secarin


Joe Wilson wrote:

Can you post the output for the failed tests?

i.e.:

 footest-13.1...
 Expected: [10]
  Got: [0]

--- Victor Secarin <[EMAIL PROTECTED]> wrote:
  
Hello, everyone. I just started to look at the software and I have two 
questions:


Question 1:

Building sqlite-3.4.1, as obtained from the cvs, on Fedora 5, 64 bits, 
with gcc 4.1.1, over glibc-2.4-11, and tcl/tcl-devel 8.4.13-1.1,

followed by "make fulltest", I get the following three failed tests:

lock4-1.3  malloc2-1.1.31.5  malloc2.1.5


Building the same with the Intel compiler icc 9.1.051, I get 8 failures 
as follows:


bind-4.4  bind-4.5  expr-2.26  malloc2.1.5  printf-13.6  utf16-bind-4.4  
utf16-bind-4.5  utf16-expr-2.26



How do I find out which matter and which do not?
Is there a mechanism whereby I can check these without bothering people?
Is the testing machinery documented anywhere?
Am I supposed to use the library if I have failed tests?
  




   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC


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

  


---
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient. Any review, 
use, distribution, or disclosure by others is strictly prohibited. If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.



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



Re: [sqlite] Replacing Clipper DB lookup application

2007-08-03 Thread john s wolter
Mark and Richard:

Thank you all for your well considered comments.  I've got enough
information to decide to spend some time evaluating SQLite as a replacement
DB.  I'll cook up some test code as a next step.   The example code will be
a good starting point.

The comments about the added safety of SQLite is of interest.  A bit of
information about DBF reliability and recovery; I know about their use
inside  commercial  Customer Relations Management(CRM) software.  Goldmine
and ACT! both use DBF C libraries in those products.  We tested them by
doing things like unplugging the computer or resetting the workstations and
the servers while the code was running.  It completely trashed the DBF's
which had to be restored from backups.  Breaking software can be fun.

The one CRM that does not have that problem that I have found is Maximizer.
It uses Pervasive Software's latest version of Btreive, a network type
database with recovery.  Maximizer crashes result in a DB rebuild on the
next program start.  It's lookups are very fast too but the databases are
specialized in design.  They have in recent years tried to put a SQL face on
that commercial product.

Most of my projects are for applications that are used over many years, 5 to
10 is not unusual.  I can't depend on companies like Microsoft et. al. to
maintain a compatible product over those time frames.  Having the source
code "just in case"  is a good idea, another to selling point for SQLite.

On 8/3/07, Mark Richards <[EMAIL PROTECTED]> wrote:
>
> john s wolter wrote:
> > I have an old Clipper DBF type application that has worked well but
> times
> > changed and changed long ago.  The feature of this DBF, non-GUI, text
> > oriented, application is that it is mostly a list lookup application
> with
> > few DB changes.  A separate Admin program does list management.  The
> list is
> > about 10,000 people long.  New requirements justify a rewrite of the
> > programs.  Rewrite environments include Mono's C#, JAVA, Python, C++,
> et.
> > al. , all of which appear supported by SQLite bindings.
> >
> > The Clipper application is very fast at these lookups which are at a
> > customer service desk where there is a queue of people impatiently
> waiting
> > in line.  Using an incremental lookup text entry box the list quickly
> > narrows to just a few entries and then a quick cursor pick chooses the
> > correct record.   Clipper DBF file indexes are a simple key-value and a
> > pointer into a DBF file's records.
>
> >That is why these lookups are so fast.
> A rather wide generalization, don't you agree?  There's more to consider.
>
> >See this xBase file format
> > description.
> > It is not a RDBMS as some stated in the past.
> This is an old argument and perhaps boils down to semantics.  The
> specification for a true RDBMS are not met, but this is not to say that
> it cannot do the job quite well.  It does but the relating isn't built
> into the Clipper engine.  You have to code for it and make sure it's
> enforced.  The format is dead without something to drive it.
>
> >
> > I am of the opinion that full SQL engine's set based extractions are too
> > slow and may not be suited to an incremental  list lookup.  However,
> SQLite
> > appears on the surface to be potentially faster than the its full SQL
> engine
> > peers.  I also like the idea of linking a library into the application,
> that
> > also looks faster a first blush.
>
> The fact that CA-Clipper applications (and expansions on the theme in
> CA-VO) are not prevalent speaks well of newer, stronger, and more
> efficient technologies.  I worked in Clipper since Nantucket's first
> product right through to the present CA-VO.  In its day the format was
> all we had and it was wonderful.  But no transactions, no rollback, and
> record/file locking had to be done manually.  Horrors if something
> crashed.  Fun to recover a DBT whose associated DBF became mangled.
>
> Certainly for simple and quick tasks a DBF format still works fine and
> Clipper will run on just about any old thing.  But I would never (now)
> in my right mind use DBF in a production setting, just as I would hold
> the same restriction to running a Windows server.  There are far better
> tools that require less time to develop and give greater all-around
> performance.  I know that's not what you asked :)
>
> >
> > I am wondering if SQLite has features that could be used to make these
> > lookups just as quick?  Can you point me , so to speak, in the correct
> > direction?
> >
> If you see a performance difference - and it's possible - consider what
> SQLite does to protect your data and make access so simple.   Protecting
> data is not build into the DBF format (there are add-ons that will give
> you some of this, but at considerable overhead).  Plus, all the Clipper
> stuff was (and probably still is) proprietary.
>
> Comparing just the lookup method (both use b-tree's I believe) does not
>

Re: [sqlite] Problem with SQLite FastCGI module "malformed database schema"

2007-08-03 Thread Joe Wilson
--- Zbigniew Baniewski <[EMAIL PROTECTED]> wrote:
> > Your trace seems to indicate it has 20 or so open 
> > connections to the same database file in the same process.
> 
> I think, at last I've traced the problem:
> 
> One of the scripts doesn't make use out of database contents at all. But at
> the beginning there was a simple check for database file presence, just to
> let the user know, if there (from any reason) could be dbfile missing:
> 
> if ($dbhandle = sqlite_open("/path/to/database/dbfile.db", 0666, 
> $sqliteerror)) {
>   $result = sqlite_unbuffered_query($dbhandle, 'select something from 
> some_table');
>   sqlite_close($dbhandle);
> } else {
>   die($sqliteerror);
> }
> 
> 
> Yes, the "$result = ..." line can be omitted (it is now, anyway...), because
> a successfull opening a database file is enough to check, whether the file
> is present, or not (although without SELECT it may be any other database
> file, with quite different tables).
> 
> My problem was caused by the fact, that there was a "SELECT" query, but
> $result handle hasn't been processed any further. After commenting out the
> "$result = ..." line there are no more "persistent" open database connections.
> 
> 
> And the question: is it normal behaviour - or is it a bug in PHP-module?
> I've got a feeling, that after "sqlite_close($dbhandle)" there should be
> assumption, that the script will not use database anymore (until ev. next
> "sqlite_open"), so all ev. other handles related to database contents should
> be immediately removed.

You are not checking the return code of the sqlite3 connection close.

sqlite3_close can fail with:

SQLITE_MISUSE

SQLITE_BUSY -> "Unable to close due to unfinalised statements"

SQLITE_ERROR

see http://sqlite.org/capi3ref.html#sqlite3_close

I have no idea if the PHP sqlite3 wrapper propogates these errors, as
the return code of sqlite3_close is not examined (see PHP wrapper below). 
Perhaps PHP somehow calls sqlite3_errcode() - who knows. It's a question 
for the PHP people.

static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;

if (H) {
pdo_sqlite_error_info *einfo = &H->einfo;

pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
if (H->db) {
sqlite3_close(H->db);
H->db = NULL;
}
if (einfo->errmsg) {
pefree(einfo->errmsg, dbh->is_persistent);
einfo->errmsg = NULL;
}
pefree(H, dbh->is_persistent);
dbh->driver_data = NULL;
}
return 0;
}



   

Be a better Globetrotter. Get better travel answers from someone who knows. 
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

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



Re: [sqlite] Re: Query Indexes

2007-08-03 Thread Mitchell Vincent
Thanks Igor! Good point on the invoice_number index - I didn't have my
brain turned on there!



On 8/2/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote:
> Mitchell Vincent <[EMAIL PROTECTED]>
> wrote:
> > Is there any way to determine if a query is using an index or not? In
> > PostgreSQL the "explain" works to tell whether a table is being
> > sequentially scanned or not..
>
> Prepend the query with EXPLAIN QUERY PLAN
>
> > I have a query :
> >
> > SELECT *,(total - balance_due) as total_paid FROM invoice_master WHERE
> > lower(invoice_number)  LIKE lower('%%')  AND status != 'Void'  AND
> > status != 'Recur'  AND status != 'Paid' AND status != 'Forwarded'
> > ORDER BY created ASC  LIMIT 25
> >
> > The lower('%%') gets used with whatever field the user is searching
> > on.
> >
> > I have indexes on created, status and invoice_number - but apparently
> > I can't make an index on lower(invoice_number) -- can I?
>
> You can't. You can, however, create an index on invoice_number with
> COLLATE NOCASE clause.
>
> Note that condition "lower(invoice_number)  LIKE lower('%%')" is always
> true - any string matches this pattern. What precisely is this supposed
> to achieve, and how an index on lower(invoice_number) is expected to
> help here?
>
> A condition on status can be more compactly written as
>
> status NOT IN ('Void', 'Recur', 'Paid', 'Forwarded')
>
> The query as written should use an index on "created" to implement ORDER
> BY clause.
>
> Igor Tandetnik
>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>


-- 
- Mitchell Vincent
- K Software - Innovative Software Solutions
- Visit our website and check out our great software!
- http://www.ksoftware.net

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



Re: [sqlite] Problem with SQLite FastCGI module "malformed database schema"

2007-08-03 Thread Zbigniew Baniewski
On Fri, Aug 03, 2007 at 06:42:39AM -0700, Joe Wilson wrote:

> Why do you think that the sqlite connection closes itself automatically?
> Did you examine the PHP wrapper code to verify it closes each connection
> in a timely fashion?

No, I read it months ago in some manual/tutorial - but cannot find it at the
moment to quote and/or give a link.

But making a simple try with a script which has just "sqlite_open" (then
some queries, or at least VACUUM) without closing "sqlite_close" shows, that
the tutorial was right. "lsof" doesn't show any lasting open connection after
such "improper" script has been run.

> Your trace seems to indicate it has 20 or so open 
> connections to the same database file in the same process.

I think, at last I've traced the problem:

One of the scripts doesn't make use out of database contents at all. But at
the beginning there was a simple check for database file presence, just to
let the user know, if there (from any reason) could be dbfile missing:

if ($dbhandle = sqlite_open("/path/to/database/dbfile.db", 0666, $sqliteerror)) 
{
  $result = sqlite_unbuffered_query($dbhandle, 'select something from 
some_table');
  sqlite_close($dbhandle);
} else {
  die($sqliteerror);
}


Yes, the "$result = ..." line can be omitted (it is now, anyway...), because
a successfull opening a database file is enough to check, whether the file
is present, or not (although without SELECT it may be any other database
file, with quite different tables).

My problem was caused by the fact, that there was a "SELECT" query, but
$result handle hasn't been processed any further. After commenting out the
"$result = ..." line there are no more "persistent" open database connections.


And the question: is it normal behaviour - or is it a bug in PHP-module?
I've got a feeling, that after "sqlite_close($dbhandle)" there should be
assumption, that the script will not use database anymore (until ev. next
"sqlite_open"), so all ev. other handles related to database contents should
be immediately removed.
-- 
pozdrawiam / regards

Zbigniew Baniewski

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



[sqlite] [VC++ 6] Error compiling VBified source

2007-08-03 Thread Gilles Ganault

Hello

	As I'd like to be able to build my own SQLite DLL for use with Visual 
Basic Classic, I followed Todd Tanner's instructions at 
www.tannertech.net/sqlite3vb/ to make the (few) required changes and 
compile with Visual C++ 6.0.


As a test, after just making those changes in the amalgamated files, I get 
an error:


//=sqlite3.h
#include 
#include 
#include 
#include 
#include 

//sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
sqlite_int64 __stdcall sqlite3_last_insert_rowid(sqlite3 *);

//=sqlite3.c
//sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
sqlite_int64 __stdcall sqlite3_last_insert_rowid(sqlite3*);

//=Compiling
=> sqlite3_last_insert_rowid,
error C2152: 'initializing' : pointers to functions with different attributes

Is it a configuration issue? Actually, I didn't find where in VC++ 6.0 to 
put the reference to the .DEF file (nothing that looks like Module 
Definiont File under Linker.)


Thanks for any tip
G. 



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



Re: [sqlite] SQLite.org needs online forms

2007-08-03 Thread Jeff Macdonald
On 8/3/07, john s wolter <[EMAIL PROTECTED]> wrote:
> Sounds like Wikipedia.  I understand that Wikipedia's software is Open
> Source and available.  Do you know of other Wiki servers that would suffice
> or be more on target?

John,

sqlite.org has a built-in wiki. There's a link on the front page in
the top right hand corner.

-- 
Jeff Macdonald
Ayer, MA

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



Re: [sqlite] SQLite.org needs online forms

2007-08-03 Thread Jeff Macdonald
On 8/3/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote:
> I expect that for most of us, we prefer to get our information "pushed" to
> us rather than having to go check laboriously each of the subject area's
> forums that we are interested in.
>
> Life is too short, otherwise.
>

Amen! :)


-- 
Jeff Macdonald
Ayer, MA

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



Re: [sqlite] UI question

2007-08-03 Thread John Stanton

Joe Wilson wrote:


--- [EMAIL PROTECTED] wrote:



Joe Wilson <[EMAIL PROTECTED]> wrote:


--- John Stanton <[EMAIL PROTECTED]> wrote:

Sqlite3 will get into a tangle with certain sequences where it does not 
accept a semicolon as a terminator or obey a CTL c.


To reproduce:

1. build sqlite3 without readline support.
2. run sqlite3 in an xterm
3. at the prompt, press cursor up
4. hit return

Nothing you do at this point will work except for Ctrl-\ to kill the process.

SQLite version 3.4.1
Enter ".help" for instructions
sqlite> ^[[A
  ...> .q
  ...> ;
  ...> select 1;


SQLite allows identifiers to be quoted using square brackets.
Like this:   CREATE TABLE [alpha]([beta],[gamma]);

In the input above, SQLite sees the beginning of a quoted
identifier in the "[A" but it never sees the terminating "]"
so it keeps asking for more input.  It things the semicolons
you are feeding it are part of the identifier.

To break out of the loop, enter "];".

Works as designed



It makes sense in hindsight.  Even though [] would be an illegal first
token in any shell or SQL command, you only attempt to tokenize/parse the 
line when you get to the end of statement ";". Would incremental 
tokenizing/parsing be easy to implement to catch this case?


Lucky in this case I happened to be running in an xterm that echoed
the ^[[A characters. Other terminal programs I've used (such as rxvt on 
cygwin) doesn't print the ^[[A to the screen at all, but instead moves 
the cursor up one line. In that case it is not obvious what is going on, 
or that ]; will take you out of that mode. I guess the user just has to 
know a little about terminal ascii escape sequences and sqlite token syntax.


It didn't cross my mind that this effect could be an artifact of the [] 
delimiters.  What xterm echoes should have been a clue.



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



[sqlite] Locking Problems with 3.4.1 on Red Hat Linux

2007-08-03 Thread Andrew Bell
Hi,

When I create a 3.4.1 SQLite database on Red Hat (2.6.9 kernel) and
try to create a table, I get a "database is locked" error.  I don't
have any problem with a non-NFS filesystem, and I also don't have any
problem with version 3.3.3.

Does anyone have any hints, or any thoughts on changes that may impact
SQLite on NFS?

Thanks,

-- 
Andrew Bell
[EMAIL PROTECTED]

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



Re: [sqlite] Re: Re: Re: how do i declare and use variables in sqlite?

2007-08-03 Thread John Stanton

Igor Tandetnik wrote:

Paul Harris <[EMAIL PROTECTED]> wrote:


anyway, this is what i'm trying to do:

eg 1
select @somevar := column1 from table1;
update table2 set column2 = @somevar;



update table2 set column2 = (select column1 from table1);

Igor Tandetnik



A note to the original poster.  Sqlite is integrated into processors 
like TCL which gives you the capability you are seeking and much more. 
We integrated Sqlite into Javascript and Javascript into Sqlite, again 
getting that functionality and much, much more.



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



Re: [sqlite] Re: Re: how do i declare and use variables in sqlite?

2007-08-03 Thread John Stanton

Paul Harris wrote:

On 03/08/07, Nikola Miljkovic <[EMAIL PROTECTED]> wrote:


[In the message "Re: [sqlite] Re: Re: how do i declare and use variables in sqlite?" on 
Aug 3, 11:47, "Paul Harris" writes:]


create temporary table vars (name text, value something);
--
insert into vars set name="x", value=0;
--
... where something = (select value from vars where name="x")...



I tried doing this, but there doesn't seem to be a way to do the same
thing with an UPDATE command ?


No way to do what with UPDATE command? What exactly are you trying to
do, and failing?



i've just realised the last statement ("...where etc etc") is probably
supposed to be part of a select statement.


Yeap, sorry for being "too conceptual", dislexic (insert/update, thanks Igor)
and obviously too confusing :-).




anyway, this is what i'm trying to do:

eg 1
select @somevar := column1 from table1;
update table2 set column2 = @somevar;


Try:

create temporary table var1 select column1 from table1;
update table2 set column2 = (select column1 from var1);

As written the second comand will likely not do what was intended
since var1 might have more than 1 row and there is no constraint
so every row in table2 will be affected. I assume that real
implementation will deal with this.




ok, so a subselect can be used.   not bad, but not as powerful as the
mysql @ variables, which can then be used in all sorts of scenarios
later, without inducing the same query over and over to get the value.

Sqlite is an embedded toolkit, not a complete DBMS server.  You can use 
it freely to integrate into applications and language processors.  If 
you have a need for such a capability as you describe you can implement 
it any way you choose, perhaps by making a wrapper around some of the 
Sqlite API.  You could add the MySql extensions to the SQL if you felt 
the need.


Meanwhile the core Sqlite library stays relatively sparse so that it can 
be embedded into projects without inflicting unecessary bloat.


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



Re: [sqlite] In-Memory Database: Delete rows on a Table increases the memory usage.

2007-08-03 Thread Christian Smith

Scott Derrick uttered:

are you saying this is a memory leak? 
sqlite never gives back the unused memory?



No, libc never gives back the memory.

It is not leaked because the malloc implementation keeps a reference to 
all the free'd heap memory in tracking it for future requests.





Christian Smith wrote:

Lokesh Babu uttered:


Hello Folks,

When I perform the DELETE operation on a Table using In-Memory Database
(":memory:"), the memory usage increases.

I tried using PRAGMA auto_vacuum=1; /* result - nothing works */
Even I tried using VACUUM table_name; /* this too isn't work */

if I perform DROP the table operation, memory usage works. Deleting the 
rows

doesn't work.

Anybody please help me in resolving this.



Memory usage goes up because SQLite must temporarily store copies of the 
old pages that store the deleted rows, in order to allow a future rollback 
if required.


Once a commit is done, the old pages are free'd, but by that time the 
memory footprint has already increased. Not many libc implementations 
release heap memory back to the OS once it's allocated.





Thanks in advance,

Lokee



--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \


- 
To unsubscribe, send email to [EMAIL PROTECTED]


- 










--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

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



[sqlite] SQLite roadmap?

2007-08-03 Thread Samuel R. Neff

Is there a roadmap of major planned features in upcoming releases?  I didn't
see anything on the wiki or site..

Thanks,

Sam 


---
We're Hiring! Seeking a passionate developer to join our team building
products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-Original Message-
From: Darren Duncan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 02, 2007 8:44 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Implementation of ANSI SQL-92 FOREIGN KEY and
referential integrity

At 2:11 PM -0700 8/2/07, Mikey C wrote:
>Does anyone know if there is a plan to implement the enforcement of the
>SQL-92 FOREIGN KEY constraints?
>
>Seems to me the No.1 missing feature.  After all, data integrity, even in
an
>embedded DB is very important and bugs in client code can easily mess up
the
>referential integrity.

I believe that this is planned; however, some other planned upates 
have higher priority and are being done first.  Note also that 
traditional foreign key constraints can only implement some kinds of 
business rules, and there are lots of others whose violation could 
cause problems, that foreign keys wouldn't help with; in theory, the 
more generic format of triggers is a more complete solution, or more 
specifically, free-form check constraints that can be comprised of 
any query are a more complete solution. -- Darren Duncan


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



Re: [sqlite] SQLite.org needs online forms

2007-08-03 Thread Mark Richards

john s wolter wrote:

SQLite.org in my opinion, needs to have online community forms.  I first
used majordomo ten years ago which is like the list manager being used for
sqlite-users@sqlite.org but in today's Internet it can be mistaken for
SPAM.  I do not know if SQLite would qualify because of the Public Domain
license but maybe sourceforge or the likes of freshmeat or other FOSS have
forms for all their hosted projects.  That would allow browsing of prior
support issues and make it easier for users to benefit from that collected
knowledege.  Let us all know how you react to this idea.


You mean "forums"?  This is an old and tired argument.

Please save the messages and search on them (I do this) or use google.

/m

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



Re: [sqlite] Problem with SQLite FastCGI module "malformed database schema"

2007-08-03 Thread Joe Wilson
--- Zbigniew Baniewski <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 01, 2007 at 03:04:35PM -0700, Joe Wilson wrote:
> 
> > Maybe the php wrapper is not closing sqlite connections correctly 
> > (or at all).
> > 
> > See if you can get the stack traces of all threads in the php process 
> > 162 via pstack, lsstack or by attaching gdb to it at runtime.
> 
> Before I'll make it: does there exist any possibility, that I made some
> mistake in PHP-scripts? If I correctly recall, even ev. omitting of
> "sqlite_close" function can't make any problem, because the connection is
> always closed even without this, just when end of script has been reached.
> 
> Are any script-related (not bugs in PHP-module) reasons possible?

Anything's possible when you're dealing with so many unrelated libraries.

Why do you think that the sqlite connection closes itself automatically?
Did you examine the PHP wrapper code to verify it closes each connection
in a timely fashion? Your trace seems to indicate it has 20 or so open 
connections to the same database file in the same process.

Maybe there's a state the PHP wrapper can get into where the close is not 
issued.


   

Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

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



Re: [sqlite] Replacing Clipper DB lookup application

2007-08-03 Thread Mark Richards

john s wolter wrote:

I have an old Clipper DBF type application that has worked well but times
changed and changed long ago.  The feature of this DBF, non-GUI, text
oriented, application is that it is mostly a list lookup application with
few DB changes.  A separate Admin program does list management.  The list is
about 10,000 people long.  New requirements justify a rewrite of the
programs.  Rewrite environments include Mono's C#, JAVA, Python, C++, et.
al. , all of which appear supported by SQLite bindings.

The Clipper application is very fast at these lookups which are at a
customer service desk where there is a queue of people impatiently waiting
in line.  Using an incremental lookup text entry box the list quickly
narrows to just a few entries and then a quick cursor pick chooses the
correct record.   Clipper DBF file indexes are a simple key-value and a
pointer into a DBF file's records.  


>That is why these lookups are so fast.
A rather wide generalization, don't you agree?  There's more to consider.


See this xBase file format
description.
It is not a RDBMS as some stated in the past.
This is an old argument and perhaps boils down to semantics.  The 
specification for a true RDBMS are not met, but this is not to say that 
it cannot do the job quite well.  It does but the relating isn't built 
into the Clipper engine.  You have to code for it and make sure it's 
enforced.  The format is dead without something to drive it.




I am of the opinion that full SQL engine's set based extractions are too
slow and may not be suited to an incremental  list lookup.  However, SQLite
appears on the surface to be potentially faster than the its full SQL engine
peers.  I also like the idea of linking a library into the application, that
also looks faster a first blush.


The fact that CA-Clipper applications (and expansions on the theme in 
CA-VO) are not prevalent speaks well of newer, stronger, and more 
efficient technologies.  I worked in Clipper since Nantucket's first 
product right through to the present CA-VO.  In its day the format was 
all we had and it was wonderful.  But no transactions, no rollback, and 
record/file locking had to be done manually.  Horrors if something 
crashed.  Fun to recover a DBT whose associated DBF became mangled.


Certainly for simple and quick tasks a DBF format still works fine and 
Clipper will run on just about any old thing.  But I would never (now) 
in my right mind use DBF in a production setting, just as I would hold 
the same restriction to running a Windows server.  There are far better 
tools that require less time to develop and give greater all-around 
performance.  I know that's not what you asked :)




I am wondering if SQLite has features that could be used to make these
lookups just as quick?  Can you point me , so to speak, in the correct
direction?

If you see a performance difference - and it's possible - consider what 
SQLite does to protect your data and make access so simple.   Protecting 
data is not build into the DBF format (there are add-ons that will give 
you some of this, but at considerable overhead).  Plus, all the Clipper 
stuff was (and probably still is) proprietary.


Comparing just the lookup method (both use b-tree's I believe) does not 
take into account the entire picture.


If you're considering SQLite, you're on the path of a very good choice.

/m

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



Re: [sqlite] SQLite.org needs online forms

2007-08-03 Thread john s wolter
Sounds like Wikipedia.  I understand that Wikipedia's software is Open
Source and available.  Do you know of other Wiki servers that would suffice
or be more on target?

On 8/3/07, Paul Harris <[EMAIL PROTECTED]> wrote:
>
> On 03/08/07, john s wolter <[EMAIL PROTECTED]> wrote:
> > Wiki's.   I have not used them myself.  What's the general idea?  Is
> there a
> > form type that would be easy to use?
> >
>
> wikis are very easy to use.  in short, its basically a "forum" where
> people can write and store information in a form that can be searched,
> browsed, and catalogued.   more like a tool for constructing a
> forever-changing book.
> useful to augment static documentation.
>
> a mailing list is like a discussion.
>
> a user forum like on sourceforge is a lot like a mailing list, except
> it is constrained into topics, logons, etc.
>
> so ideally, if one were to have a discussion on (for example) updates
> based on selects, as in another thread i've just replied to, once i
> have learned something i would then go to the wiki and put that on a
> page somewhere sensible.   if it wasn't a stupid question.  if it was,
> then i would put the answer on a "AnswersToStupidQuestions" wiki page.
>
> do this enough, and people will first refer to the wiki before asking
> for help on the mailing list.
>
> the mingw wiki is a good example of this.
>



-- 
John S. Wolter President
Wolter Works
Mailto:[EMAIL PROTECTED]
Desk 1-734-665-1263
Cell: 1-734-904-8433


Re: [sqlite] UI question

2007-08-03 Thread Joe Wilson


--- [EMAIL PROTECTED] wrote:

> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > --- John Stanton <[EMAIL PROTECTED]> wrote:
> > > Sqlite3 will get into a tangle with certain sequences where it does not 
> > > accept a semicolon as a terminator or obey a CTL c.
> > 
> > To reproduce:
> > 
> > 1. build sqlite3 without readline support.
> > 2. run sqlite3 in an xterm
> > 3. at the prompt, press cursor up
> > 4. hit return
> > 
> > Nothing you do at this point will work except for Ctrl-\ to kill the 
> > process.
> > 
> > SQLite version 3.4.1
> > Enter ".help" for instructions
> > sqlite> ^[[A
> >...> .q
> >...> ;
> >...> select 1;
> 
> SQLite allows identifiers to be quoted using square brackets.
> Like this:   CREATE TABLE [alpha]([beta],[gamma]);
> 
> In the input above, SQLite sees the beginning of a quoted
> identifier in the "[A" but it never sees the terminating "]"
> so it keeps asking for more input.  It things the semicolons
> you are feeding it are part of the identifier.
> 
> To break out of the loop, enter "];".
> 
> Works as designed

It makes sense in hindsight.  Even though [] would be an illegal first
token in any shell or SQL command, you only attempt to tokenize/parse the 
line when you get to the end of statement ";". Would incremental 
tokenizing/parsing be easy to implement to catch this case?

Lucky in this case I happened to be running in an xterm that echoed
the ^[[A characters. Other terminal programs I've used (such as rxvt on 
cygwin) doesn't print the ^[[A to the screen at all, but instead moves 
the cursor up one line. In that case it is not obvious what is going on, 
or that ]; will take you out of that mode. I guess the user just has to 
know a little about terminal ascii escape sequences and sqlite token syntax.



   
Ready
 for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

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



Re: [sqlite] SQLite.org needs online forms

2007-08-03 Thread Andrew Finkenstadt
I expect that for most of us, we prefer to get our information "pushed" to
us rather than having to go check laboriously each of the subject area's
forums that we are interested in.

Life is too short, otherwise.


[sqlite] VACUUM problems

2007-08-03 Thread Jiri Hajek
Hello,

I recently got some debug logs from my users that indicate problems
with VACUUM command. The error message is:

SQL logic error or missing database (1).

This is using the latest SQLite (3.4.1) Windows DLL.

I tried to rule out my coding mistakes, at the moment of the problem
there is only one connection to the DB, this connection doesn't have
any other SQLite command open, there isn't any transaction in progress
- all this confirmed using debug logs and also safety measures in the
code (CriticalSections, etc.).

Does anyone has any idea what could be wrong? Any suggestiong
regarding getting more information useful for debugging the problem?

Thanks,
Jiri

P.S.: Except for this, everything seems to work fine for quite large
user base - and SQLite is used pretty heavily in my app.

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



Re: [sqlite] UI question

2007-08-03 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- John Stanton <[EMAIL PROTECTED]> wrote:
> > Sqlite3 will get into a tangle with certain sequences where it does not 
> > accept a semicolon as a terminator or obey a CTL c.
> 
> To reproduce:
> 
> 1. build sqlite3 without readline support.
> 2. run sqlite3 in an xterm
> 3. at the prompt, press cursor up
> 4. hit return
> 
> Nothing you do at this point will work except for Ctrl-\ to kill the process.
> 
> SQLite version 3.4.1
> Enter ".help" for instructions
> sqlite> ^[[A
>...> .q
>...> ;
>...> select 1;

SQLite allows identifiers to be quoted using square brackets.
Like this:   CREATE TABLE [alpha]([beta],[gamma]);

In the input above, SQLite sees the beginning of a quoted
identifier in the "[A" but it never sees the terminating "]"
so it keeps asking for more input.  It things the semicolons
you are feeding it are part of the identifier.

To break out of the loop, enter "];".

Works as designed
--
D. Richard Hipp <[EMAIL PROTECTED]>


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



Re: [sqlite] Replacing Clipper DB lookup application

2007-08-03 Thread drh
"john s wolter" <[EMAIL PROTECTED]> wrote:
> I have an old Clipper DBF type application  Clipper DBF file 
> indexes are a simple key-value and a pointer into a DBF file's 
> records.  That is why these lookups are so fast
> 
> I am of the opinion that full SQL engine's set based extractions are too
> slow 
> 
> I am wondering if SQLite has features that could be used to make these
> lookups just as quick?  Can you point me , so to speak, in the correct
> direction?
> 

Why do you think a full SQL engine will be too slow?  Under 
the hood, every SQL database engine I know of (including 
SQLite) uses simple key/value btrees just like Clipper DBF.  
They just hide the ugly details from the programmer. Working 
with a key/value database (like Berkeley DB for example) 
compared to working in SQL is similar to the difference in 
programming in assembly language versus a high-level language.
The level of abstraction is higher, but the same CPU is used 
to run them both.

As a performance test, I created a "key/value" table in SQLite
and filled it with 10 rows of random data.  20MB of data
roughly.  The table is:

   CREATE TABLE t1(key, value, UNIQUE(key,value));

I filled it with 10 iterations of this:

   INSERT INTO t1 VALUES(hex(randomblob(10)), hex(randomblob(30)));

So each key was a random 20-character string and each data was a
random 60-character string.  A real application would contain more
useful data, obviously.  But this seems like a good test set for
performance.

To measure performance, I did this:

   SELECT b FROM t1 WHERE a=(SELECT hex(randomblob(10)));

This simulates a lookup of a single value from the table.  Actually,
the lookup probably missed each time.  But the time needed to do a
failed lookup and a successful lookup is the same, so I don't much
care.

On 1000 iterations the average time to do a lookup was 38 microseconds.

To take the test further, consider the following query:

   SELECT b FROM t1 WHERE a>=(SELECT hex(randomblob(10))) LIMIT 10;

In this case we are not looking up a single element, but 10 elements
that are near a randomly choosen value.  In this case, 10 rows of
result are nearly always returned even if the key never matches
exactly.

In 1000 iterations the average time per query was 96 microseconds.

So we are talking in excess of 1 queries per second on a 20MB
database.  Performance will fall off as the logorithm of the size
of the database file, of course.  And it will be much slower with
a cold cache due to disk latency.  But how many queries per second
do you really need in order to keep a service desk operator happy?

--
D. Richard Hipp <[EMAIL PROTECTED]>


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



[sqlite] Re: Indexes usage on Foreign Key

2007-08-03 Thread Igor Tandetnik

Bharath Booshan L
<[EMAIL PROTECTED]> wrote:

Consider the following schema

Create table Library(LibraryID INTEGER PRIMARY KEY AUTOINCRMENT,
LibraryName
TEXT);
Create table Book(LibraryID INTEGER REFERENCES Library, BookID TEXT
PRIMARY
KEY, BookName TEXT);

Now I believe Library(LibraryID) is automatically indexed.

But when I use Book(LibrayID) field in one of my Query as below I
believe it
is not indexed as the query execution takes more amount of time.


Correct. If you want it indexed, create an index on it.


But when I index Book(LibraryID) it is quick enough. But is it
meaningful to
index Foreign Key ?


As long as it improves performance of a query you need, why not?


Will the Foreign key use the same index as of its counterpart in
original
table or should it be separately indexed ?


Separate index, of course. There ain't no such thing as an index shared 
between two tables.



I am not able to see the Query plan through "Explain Query plan" &
".explain" command. " Explain Query plan" returns a syntax error and
.explain does nothing :(


EXPLAIN QUERY PLAN first appeared in SQLite v3.2.6. The version you use 
doesn't support it.


Igor Tandetnik 



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



[sqlite] Re: Re: Re: how do i declare and use variables in sqlite?

2007-08-03 Thread Igor Tandetnik

Paul Harris <[EMAIL PROTECTED]> wrote:

anyway, this is what i'm trying to do:

eg 1
select @somevar := column1 from table1;
update table2 set column2 = @somevar;


update table2 set column2 = (select column1 from table1);

Igor Tandetnik

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



Re: [sqlite] "database is locked" SQLITE_BUSY when db is on network drive...

2007-08-03 Thread

Hi Chase,

it connects fine.  no errors.  but then i try to create a temp  
table (which, like i said, works if the db is local) it fails  
immediately with SQLITE_BUSY "database is locked".


It's some Mac vs SQLite bug. You can recompile SQLite to fix it. See  
the old post below. And search the archives for "locked" in the subject.


Tom

 
From: T&B <[EMAIL PROTECTED]>
Date: 11 May 2007 10:54:02 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] database is locked error

Is there a timetable for including the fix for opening SQLite files  
on a shared volume? Since it's fairly trivial, is there a reason why  
it hasn't been included yet?


Thanks,
Tom

 
From: T&B <[EMAIL PROTECTED]>
Date: 29 April 2007 3:35:00 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] database is locked error

Following up an old thread:

The SQLite sources include an (Apple-supplied) patch to work around  
the problem. Recompile

with

   -DSQLITE_ENABLE_LOCKING_STYLE=1

We are working toward turning on this patch by default, but we are  
not quite there yet.


I compiled and ran SQLite 3.3.17 and got the old error again when  
accessing a database file on a server volume, with SQLite saying it  
is locked.


Does this mean that we are still "not quite there yet" with a default  
fix? Any time frame?


Thanks,
Tom

--
Best value broadband in Australia.
$3 per GB excess instead of $150 from BigPond
Free uploads, free morning downloads.
http://www.tandb.com.au/broadband/?sig


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