Re: [sqlite] How to link against sqlite3.dll

2006-09-27 Thread Mike Polyakov

Hi,
Sorry I forgot to specify that. I am using Visual Studio 2005 C++
compiler. Right now I'm including all the .c file in my project and
compiling it that way, but it would be nice to have a .lib file to
link against and use the provided sqlite3.dll.
(as I do under linux)

On 9/27/06, Trevor Talbot <[EMAIL PROTECTED]> wrote:

On 9/27/06, Mike Polyakov <[EMAIL PROTECTED]> wrote:

> I'm trying to use the provided sqlite3.dll, but there is no .lib file
> available, so I have to extract the functions through their string
> names. Is there a lib file that I can just link against that will do
> that automatically. If there is, why isn't it included along with
> sqlite3.dll and if there is not, is it possible to build it?

The lib format is compiler dependent.  What compiler are you using?

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




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



Re: [sqlite] Updating a whole column at once

2006-09-27 Thread Trevor Talbot

On 9/27/06, James W. Walker <[EMAIL PROTECTED]> wrote:


What is the fastest way to change the values in one column in every
row?  What I thought of was like so:

BEGIN TRANSACTION;
UPDATE MyTable SET TheCol=7 WHERE keyCol=1;
UPDATE MyTable SET TheCol=8 WHERE keyCol=2;
... and so on for each row
COMMIT;



Kurt Welgehausen <[EMAIL PROTECTED]> wrote on 10 Jan 2004:
>  What you propose will work, but you haven't given enough
>  info for anyone to tell you whether it's the best solution.

I'm not sure what other information would be helpful.  The table has
38 columns, a few of which may be fairly large blobs.  The number of
rows is obviously variable, but let's say it's on the order of 1000.


If the column values are algorithmically related to each other, then
you can have sqlite do it in one pass, possibly using custom functions
to determine relationship.  For the simple example you gave, something
like:

UPDATE MyTable SET TheCol = keyCol + 6;

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



Re: [sqlite] How to link against sqlite3.dll

2006-09-27 Thread Trevor Talbot

On 9/27/06, Mike Polyakov <[EMAIL PROTECTED]> wrote:


I'm trying to use the provided sqlite3.dll, but there is no .lib file
available, so I have to extract the functions through their string
names. Is there a lib file that I can just link against that will do
that automatically. If there is, why isn't it included along with
sqlite3.dll and if there is not, is it possible to build it?


The lib format is compiler dependent.  What compiler are you using?

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



[sqlite] Updating a whole column at once

2006-09-27 Thread James W. Walker
I was about to post a question, and then I was embarrassed to find 
that I already asked the question more than 2 years ago, and I am 
still unsure of the answer.  The question was:


What is the fastest way to change the values in one column in every 
row?  What I thought of was like so:


BEGIN TRANSACTION;
UPDATE MyTable SET TheCol=7 WHERE keyCol=1;
UPDATE MyTable SET TheCol=8 WHERE keyCol=2;
... and so on for each row
COMMIT;

"Greg Obleshchuk" <[EMAIL PROTECTED]> wrote on 10 Jan 2004:

 That's it, now make sure you have an index on KeyCol1 and your there.


I had neglected to mention that keyCol is an INTEGER PRIMARY KEY 
column.  I have since read that it is counterproductive to make an 
index on an INTEGER PRIMARY KEY column.


Kurt Welgehausen <[EMAIL PROTECTED]> wrote on 10 Jan 2004:

 What you propose will work, but you haven't given enough
 info for anyone to tell you whether it's the best solution.


I'm not sure what other information would be helpful.  The table has 
38 columns, a few of which may be fairly large blobs.  The number of 
rows is obviously variable, but let's say it's on the order of 1000.


The only other approach I've thought of goes like this:

* Create a temporary table TChange with two columns TValue and TKey, 
holding the updated values of TheCol and corresponding values of 
keyCol.

* Create another temporary table TNew with the same columns as MyTable.
* INSERT INTO TNew
SELECT 
FROM MyTable, TChange
WHERE MyTable.keyCol = TChange.TKey;
* DROP TABLE MyTable;
* CREATE TABLE MyTable ;
* INSERT INTO MyTable SELECT * FROM TNew;
* DROP TABLE TNew;
* DROP TABLE TChange;

I could try it, of course.  I'm just curious whether someone with a 
better mental model of what the database engine is doing would easily 
see whether this makes sense.

--
  James W. Walker, ScriptPerfection Enterprises, Inc.
  

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



[sqlite] How to link against sqlite3.dll

2006-09-27 Thread Mike Polyakov

Hi,

I'm trying to use the provided sqlite3.dll, but there is no .lib file
available, so I have to extract the functions through their string
names. Is there a lib file that I can just link against that will do
that automatically. If there is, why isn't it included along with
sqlite3.dll and if there is not, is it possible to build it?
Thanks.

-Mike

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



Re: [sqlite] How to get version of an SQLIte file

2006-09-27 Thread Kees Nuyt
On Wed, 27 Sep 2006 14:06:50 +0200, you wrote:

>Hello 
>I'm trying to develop an application with C# Mono and SQLite and I have
>a problem to know wich SQLIte version is the file I want open.
>
>Do you know a way to get this version before I open the file?

The first 15 bytes of the sqlite database file tell you which
file format it is. The file format doesn't change that often, so
it can be compatible with several software versions.

>LordPhoenix
>
>PS : Sorry for my English I'm french and don't speak this
>language very often :)

Many US citizens write worse English than you do ;)
-- 
  (  Kees Nuyt
  )
c[_]

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



Re: [sqlite] auxiliary threads in sqlite3

2006-09-27 Thread drh
Dixon <[EMAIL PROTECTED]> wrote:
> I'm running with sqlite 3.3.6 in a windows environment.  I have NOT 
> defined "THREADSAFE=1".  My app is single threaded, however, multiple 
> instances of the app use sqlite3 on the same DB's, simultaneously.  My 
> question -- Does SQLite ever start auxiliary threads?
> 

No.  Not in windows.

Under Unix, SQLite has to start a couple of short-lived threads
the first time it is used in order to test how threads and posix
locks interact on that particular system.  Those threads set a 
global variable then exit and are never restarted.

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


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



AW: [sqlite] auxiliary threads in sqlite3

2006-09-27 Thread Michael Ruck
I can't answer the question regarding SQLite for you, but Windows does start
auxiliary threads in some APIs. 

-Ursprüngliche Nachricht-
Von: Dixon [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 27. September 2006 16:36
An: sqlite-users@sqlite.org
Betreff: [sqlite] auxiliary threads in sqlite3

I'm running with sqlite 3.3.6 in a windows environment.  I have NOT defined
"THREADSAFE=1".  My app is single threaded, however, multiple instances of
the app use sqlite3 on the same DB's, simultaneously.  My question -- Does
SQLite ever start auxiliary threads?


-
To unsubscribe, send email to [EMAIL PROTECTED]

-



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



[sqlite] auxiliary threads in sqlite3

2006-09-27 Thread Dixon
I'm running with sqlite 3.3.6 in a windows environment.  I have NOT 
defined "THREADSAFE=1".  My app is single threaded, however, multiple 
instances of the app use sqlite3 on the same DB's, simultaneously.  My 
question -- Does SQLite ever start auxiliary threads?


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



[sqlite] Re: Does SELECT cover uncommitted INSERTS?

2006-09-27 Thread Rafael Buchbinder

Thanks a lot!


-Original Message-
From: Igor Tandetnik [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 27, 2006 2:26 PM
To: SQLite
Subject: [sqlite] Re: Does SELECT cover uncommitted INSERTS?

Rafael Buchbinder  wrote:
> Does a SELECT query return rows from uncommitted inserts on same
> sqlite3 handle (and same thread) ?

Yes. The transaction sees any changes it itself has made.

> I assume it does not do that when BEGIN; INSERT ...; END; is done on a 
> distinct sqlite3 handle (and different thread).

Since SQLite employs a single writer/many readers lock, it's simply impossible 
for SELECT to execute on one connection while a writer transaction is still 
open on another connection. So the question is moot.

Igor Tandetnik 


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



[sqlite] Re: Does SELECT cover uncommitted INSERTS?

2006-09-27 Thread Igor Tandetnik

Rafael Buchbinder  wrote:

Does a SELECT query return rows from uncommitted inserts on same
sqlite3 handle (and same thread) ?


Yes. The transaction sees any changes it itself has made.


I assume it does not do that when BEGIN; INSERT ...; END; is done on
a distinct sqlite3 handle (and different thread).


Since SQLite employs a single writer/many readers lock, it's simply 
impossible for SELECT to execute on one connection while a writer 
transaction is still open on another connection. So the question is 
moot.


Igor Tandetnik 



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



[sqlite] How to get version of an SQLIte file

2006-09-27 Thread lordphoenix
Hello 
I'm trying to develop an application with C# Mono and SQLite and I have
a problem to know wich SQLIte version is the file I want open.

Do you know a way to get this version before I open the file?


LordPhoenix

PS : Sorry for my English I'm french and don't speak this language very
often :)



signature.asc
Description: PGP signature


[sqlite] Does SELECT cover uncommitted INSERTS?

2006-09-27 Thread Rafael Buchbinder

Hi, list!

I think my question is totally a newbie one, but still:

Does a SELECT query return rows from uncommitted inserts on same sqlite3 handle 
(and same thread) ?

I assume it does not do that when BEGIN; INSERT ...; END; is done on a distinct 
sqlite3 handle (and different thread).

Thanks.

rafi


Re: [sqlite] SQLite under linux

2006-09-27 Thread Lloyd
Thanks everybody, I have downloaded the library RPM from
http://rpm.pbone.net/

and the library name is 

libsqlite-3.2.1-1.i386.rpm

It may be useful for newbie like me...

and did as what you said. And works fine...

Thanks, 
 Lloyd.


On Wed, 2006-09-27 at 10:08 +0200, Markus Hoenicka wrote:
> Lloyd <[EMAIL PROTECTED]> was heard to say:
> 
> > Unfortunately, I don't know how to install this library in my system.
> > Please help me.. If I am dealing with the wrong file, please let me know
> > from where I can get the needed installable library.
> >
> 
> Maybe you should tell us which system you run. Most Linux distributions offer
> SQLite as an easy-to-install package. E.g. on Debian you'd do something like:
> 
> apt-get install libsqlite3-dev libsqlite3-0 sqlite3
> 
> Once that is installed, you'll just have to insert the sqlite header file into
> your sources and add -lsqlite3 to your gcc command line in order to build an
> app that uses SQLite.
> 
> regards,
> Markus
> 


__
Scanned and protected by Email scanner

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



Re: [sqlite] SQLite under linux

2006-09-27 Thread Markus Hoenicka
Martin Jenkins <[EMAIL PROTECTED]> was heard to say:

> 3. make distclean doesn't remove the installed files from usr/local
>

I believe it is not supposed to. "make distclean" should remove any files from
your build directory that either "configure" or "make" created. This usually
returns your build directory to the state right after unpacking the sources
from the tarball. "make uninstall" should remove installed files though.

regards,
Markus


-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


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



Re: [sqlite] SQLite under linux

2006-09-27 Thread Markus Hoenicka
Lloyd <[EMAIL PROTECTED]> was heard to say:

> Unfortunately, I don't know how to install this library in my system.
> Please help me.. If I am dealing with the wrong file, please let me know
> from where I can get the needed installable library.
>

Maybe you should tell us which system you run. Most Linux distributions offer
SQLite as an easy-to-install package. E.g. on Debian you'd do something like:

apt-get install libsqlite3-dev libsqlite3-0 sqlite3

Once that is installed, you'll just have to insert the sqlite header file into
your sources and add -lsqlite3 to your gcc command line in order to build an
app that uses SQLite.

regards,
Markus

-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


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