Re: [sqlite] SELECT on empty fields ??

2006-11-28 Thread Marten Feldtmann

There are good reasons to have "NULL" values - though they can make the live
a bit harder. Use them - even Microsoft has found out, that they made a 
big mistake

in .NET 1.x and corrected them in 2.0 by introducing nullable types.

Darren Duncan schrieb:
You can save your self a lot of grief by declaring all of your fields 
to be NOT NULL and default the text fields to the empty string, ''. 
Use '' rather than NULL when you don't have a name.  Then you can 
simply say "where foo=''". -- Darren Duncan





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



[sqlite] Query

2006-11-28 Thread priyaranjan . singh
Hi,

I am new to database programming, It will be great if somebody will answer 
these queries:

Query 1)

Say, I have a table which is having following column

1) STRING 1( string: 12 char max) 
2) STRING 2 (string, 12 char max) 
3) path( long string)
4) State ( boolean)
 5) pupose ( 1 byte)

Assume that I have 1000 records in the table.

My requirement is to search data with below 'SELECT' statement with less 
performance issue
My query will be like this:

"SELECT  * from database where STRING1 = 'x' && STRING2 = 'y' && STATE = 1 
&& purpose = 'z'"

To achive this whether I need to attach given INDEX with the table so that 
during INSERT it will be inserted in a sorted order
"Create INDEX  INDX on database( STRING1, STRING2, state, purpose)" 

i)
If above index is present then the SELECT statement given, 
iterates to the all rows present in the table or it directly jumps to the 
block where entries satisfying STRING1 = 'x'  ??
ii)

Whether INDEXInng based on String( 12 char) gives performace 
problem???
iii)

Whether this insertion will be like LINK LIST ( fast) or like 
Array(slow)??
iv)
Iis there any other way to call Select statement with less 
performance issue?

Query 2)
What will be the performance issue if I create INDEX with PATH( Long text) 
in ASC or DSC mode for the above table


Please revert back.

Thanks and Regards,
PriyaranjanS








-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it immediately. Neither Symbian nor any of
its Affiliates accepts liability for any corruption, interception,
amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in
compliance with Symbian corporate policy. *
*


[sqlite] Selection Time

2006-11-28 Thread Lloyd
Hi,
  How much time can it take to perform 2000 selection queries on the
same database ?  Mostly the result set will contain only 1 raw. Is there
is any way to improve the selection speed?

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

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



Re: [sqlite] Format change to fts2 module.

2006-11-28 Thread Scott Hess

http://www.sqlite.org/cvstrac/tktview?tn=2046 should fix this for fts1 and fts2.

-scott

On 11/21/06, Ralf Junker <[EMAIL PROTECTED]> wrote:

Hello Scott Hess,

>>Not directly related to the format change, but did you have a chance
>>to look at ticket #2046?
>
>Yes, I took a look at it - I _believe_ that it's not actually an issue
>with fts2, because the sequence of virtual-table calls don't really
>make sense.  I'm going to try implementing a simpler virtual table to
>isolate the problem better.

This is great news - especially since this problem is annoying me a lot. Please 
let me know if I can be of any help.

Ralf


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




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



[sqlite] Re: PRAGMA case_sensitive_like doesn't work

2006-11-28 Thread Igor Tandetnik

谢谢谢 <[EMAIL PROTECTED]> wrote:

i need to select data from my sqlite database and i want the data
should be ordered by a special column;
my searches of the db should not be case_sensitive;
my sql statement is like:

sqlite> select * from customlist order by name;

i found the result is case_sensitive


select * from customlist order by name collate nocase;

Igor Tandetnik 



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



[sqlite] Re: make test fails for 32bit integers (-DSQLITE_INT64_TYPE=int -DSQLITE_32BIT_ROWID=1)

2006-11-28 Thread Steffen Gutmann
I have submitted it as ticket #2089 and named it "decoupling
sqlite_int64 from other 64 bit datatypes".  I also made another few
changes and now make test reports even fewer errors than before
(attached in the ticket).  The only cases it fails are when using big
files and when the integer values don't fit into 32 bit (these are now
handled as floating point values in most cases).  Please have a look.

I believe the tester in the previous thread did not check with floating
point values (or the architecture he was testing on used only 4 byte
floats).  The shifting 32 bits left issue might actually work okay for
most compilers as they simply ignore the shifting and something like
((x << 32) | y) has the same result as (x | y).  When the database does
not contain any true 64bit integers then x will always be zero and the
ORing will not cause any harm.  But generally speaking a compiler might
give unpredictable results for such shifting oparations (as you pointed
out) and the result should not be used in furter computations.

Best regards,

   Steffen


 

Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

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



[sqlite] PRAGMA case_sensitive_like doesn't work

2006-11-28 Thread 谢谢谢

i need to select data from my sqlite database and i want the data should be
ordered by a special column;
my searches of the db should not be case_sensitive;
my sql statement is like:

sqlite> .head on
sqlite> select * from customlist order by name;
customId|name
X3F15C8HJ9|Bill Gates W2
DNVFWDR82J|DAWSON
P7BWH9N705|H. Packard
Y57SUQJX86|J.Michale.Chanel
2KK7N5QJLH|J.W. Bush
9Y1P3E02OR|Jack
L5M0PO2YMU|John.Smego
5RU68C4KRY|dragongirl
66XDASL6YK|lisa
CGF9F3BNXE|michel-Jackson

i found the result is case_sensitive; i tried PRAGMA case_sensitive_like =
0; but it doesn't work;

sqlite> PRAGMA case_sensitive_like = 0;
sqlite> select * from customlist order by name;
customId|name
X3F15C8HJ9|Bill Gates W2
DNVFWDR82J|DAWSON
P7BWH9N705|H. Packard
Y57SUQJX86|J.Michale.Chanel
2KK7N5QJLH|J.W. Bush
9Y1P3E02OR|Jack
L5M0PO2YMU|John.Smego
5RU68C4KRY|dragongirl
66XDASL6YK|lisa
CGF9F3BNXE|michel-Jackson

is there anyway to make the select result not to be case_sensitive?
thanks!


Re: [sqlite] Music Files

2006-11-28 Thread John Stanton
I cannot be much help since we never use VB or other similar proprietary 
 software prisons.  However I did see this set of notes from someone 
who was using Sqlite from VB and created a modified sqlite.h.

http://www.persistentrealities.com/index.php?p=18

If you don't already have a lot of VB code it may be a good time to look 
at using a different tool which will run on Linux and OS/X as well as 
Windows.


made hendra wrote:

Hello John,

Wednesday, November 29, 2006, 1:08:56 AM, you wrote:


Here are a couple of links to get you started.  I suggest you google 
your way until you find something which suits you.




http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers
http://www.freevbcode.com/ShowCode.asp?ID=6893



I already have googling and i still not found wrapper that suit on me.
I already have try AGS_SQLITE wrapper too, it nice but it still using
sqlite2 library. Do you have some reference, where i can learn about
making wrapper, a tutorial maybe. I intend to cook wrapper for my self (i hope) 
:)


Best Regards,
made hendra











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




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



[sqlite] Indexing LIKE. Was: case insensitivity

2006-11-28 Thread drh
"Igor Tandetnik" <[EMAIL PROTECTED]> wrote:
> Dixon Hutchinson
>  wrote:
> > Sorry, meant to include a reference to 'p' in my select:
> >  SELECT * FROM foo WHERE bar LIKE 'something' AND p='some_int';
> 
> An expression involving LIKE cannot use an index anyway.

This is mostly true, but there are exceptions.  LIKE might
use an index if:

   (1) The left-hand side is an indexed column.
   (2) The like() function has not been overloaded.
   (3) Case-sensitive LIKE is turned on OR the left-hand side
   column is COLLATE NOCASE
   (4) The right-hand side is a literal string, not an expression,
   or parameter, or column.
   (5) The first character of the literal string on the right-hand
   side is not a wildcard.

If all of the above are true (and as it happens, they are all true
in the example above, assuming the use of COLLATE NOCASE on the
foo.bar column) then an index will be used to speed up the LIKE.
Actually, the LIKE term itself is unaltered and does not itself
use an index.  But the presense of the LIKE causes two new "virtual"
terms to be added to the WHERE clause like this:

... AND bar>='something' AND bar<'somethinh'

And these two virtual terms might well use an index.
So even though LIKE does not itself use an index, it sort of
provokes the use of an index indirectly.

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


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



[sqlite] sqlite project announcement: "Image Collector"

2006-11-28 Thread Jay Sprenkle

Good evening all,

The image collector project is nearing release status. This project
allows art enthusiasts to more easily collect, organize, and view
images from the internet.

The project is a suite of programs that all cooperate.

* A firefox browser plugin identifies, downloads, and documents the
source of images in an sqlite database.

* The import program imports non web based images from whatever media
your computer supports.

* The wall paper changer program uses the database to present images
from your collection. You can easily visit the web page that was the
source of the image,
edit it, or remove it from your collection.

* The screen saver program presents images from your collection.

I'm just completing the debugging now. If anyone is interested in
helping test or providing suggestions please contact me?

The next step in the evolution of the project is a web site with the
ability to suggest images you may like but have not seen based on
comparisons of many users collections.

My apologies if I've spammed you.


Jay


--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

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



Re[2]: [sqlite] Music Files

2006-11-28 Thread made hendra
Hello John,

Wednesday, November 29, 2006, 1:08:56 AM, you wrote:

> Here are a couple of links to get you started.  I suggest you google 
> your way until you find something which suits you.

> http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers
> http://www.freevbcode.com/ShowCode.asp?ID=6893

I already have googling and i still not found wrapper that suit on me.
I already have try AGS_SQLITE wrapper too, it nice but it still using
sqlite2 library. Do you have some reference, where i can learn about
making wrapper, a tutorial maybe. I intend to cook wrapper for my self (i hope) 
:)


Best Regards,
made hendra











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



[sqlite] Re: Re: case insensitivity

2006-11-28 Thread Igor Tandetnik

Dixon Hutchinson
 wrote:

Sorry, meant to include a reference to 'p' in my select:
 SELECT * FROM foo WHERE bar LIKE 'something' AND p='some_int';


An expression involving LIKE cannot use an index anyway. This query 
would use the index to drill down to the rows having p=some_int, then 
scan those sequentially.



But that raises the question of the order of the columns within
UNIQUE().  Should I put the most "unique" column first, or the thing
most easily compared on (ie the integer), or ...


This depends on the queries you expect to speed up. If you always use 
both columns in the condition (in a way that can use index) then I 
believe the order does not matter. If you also need to run queries 
putting a condition on just one field, put this field first.



And does using "bar
TEXT" vs "bar TEXT COLLATE NOCASE" affect the answer.


Not really, as long as comparisons in the query condition match the way 
the index was built.



My own testing says that in the originally posed case, using "COLLATE
NOCASE" is just a titch faster than using LIKE.


Run EXPLAIN QUERY PLAN on your query, see if the index is used.

Igor Tandetnik 



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



[sqlite] Re: Format change to fts2 module.

2006-11-28 Thread Scott Hess

http://www.sqlite.org/cvstrac/chngview?cn=3520
http://www.sqlite.org/cvstrac/chngview?cn=3513
http://www.sqlite.org/cvstrac/chngview?cn=3512

Changed fts2.c to store smaller terms in interior nodes, and to
delta-encode them.  This improves function in the face of very large
terms (hundreds and thousands of characters, so not likely for most
natural language texts).

I have no further plans that will require changes to fts2's storage
format.  I hope there aren't any bugs designed in :-).

-scott


On 11/13/06, Scott Hess <[EMAIL PROTECTED]> wrote:

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

This changes the storage to delta-encode docids, rather than storing
them in absolute form.  Unfortunately, since this changes the format
of the backing data, if you've been experimenting with fts2 databases,
you'll have to regenerate them (see the email snippet below).

I'm going to try to get a couple other format-changes checked in this
week, in the hopes of getting the fts2 file format frozen.

Thanks,
scott


On 10/12/06, Scott Hess <[EMAIL PROTECTED]> wrote:
> Caveats: It uses a new storage format, and there is currently no
> support for "upgrading" a table from fts1 to fts2.  Additionally, I
> have a number of follow-on changes which will be going in over the
> next couple weeks, some of which are likely to break data
> compatibility.  I'm just tossing this out here in case people are
> interested in experimenting with it.



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



Re: [sqlite] C++ SQLite

2006-11-28 Thread John Stanton

There us very little to learn, just equivalent names for types.

RB Smissaert wrote:

Yes, that looks to be the way to do it. Basically will have to learn how to
translate C defines to VB declares.

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 21:58

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite

Maybe all you have to do is to make yourself a list og VB types cross 
referenced to the fundamental type used in the Win32 and Sqlite APIs. 
Then you could link any library into your VB programs.


RB Smissaert wrote:


You might be right, but with the Win32 API you have loads of nice
documents/programs (I like the API guide from KPD) that help you out.
All I have to do is copy their declares straight to VB and look at the


data


types I have to provide. Is the same available for the SQLite API?

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:43

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite

If you can use the Win32 API you can use the Sqlite API.  Just because 
they can be called from C programs does not make them "all to do with C".


RB Smissaert wrote:



Will have a look, but I was looking for a text geared towards VB. I take


it



the documentation that comes with SQLite is all to do with C.
In fact I already have a wrapper that seems to work well, the one from
TerraInformatica, but maybe there was more control if I could write my


own.



RBS

-Original Message-
From: Clay Dowling [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:19

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite


[EMAIL PROTECTED] said:




Thanks. Would you know any VB source code that wraps all the possible
declares in a class? Or do you know where to find the documentation
to make all the possible declares in VB/VBA?

RBS



The SQLite documentation will give you everything you need to write the
wrapper.  The sqlite.h file in the source bundle would also be a great
help.  You may also be able to find a wrapper already written linked on
the SQLite web site.

Clay Dowling





Yes.  It's a regular windows DLL, so it will behave like all other
Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:




Can I call the SQLite API (as in the dll SQLite.dll) directly from
VB or do I need the wrapper? So, could it work from VB with declares
as I use for the Windows API?

RBS





sebcity wrote:




How would one go about using c++ (Visual Studio.NET) to call and
display
SQLite tables. C++ wrappers?


You should be able to call the Sqlite3 API directly.









-




To unsubscribe, send email to [EMAIL PROTECTED]








-










-




To unsubscribe, send email to [EMAIL PROTECTED]








-




--
Simple Content Management
http://www.ceamus.com










-




To unsubscribe, send email to [EMAIL PROTECTED]








-










-




To unsubscribe, send email to [EMAIL PROTECTED]








-











-
To unsubscribe, send email to [EMAIL PROTECTED]






-








-


To unsubscribe, send email to [EMAIL PROTECTED]




-




-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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




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



Re: [sqlite] Re: case insensitivity

2006-11-28 Thread Dixon Hutchinson

Igor, Dennis, Richard

Sorry, meant to include a reference to 'p' in my select:
 SELECT * FROM foo WHERE bar LIKE 'something' AND p='some_int';

But that raises the question of the order of the columns within 
UNIQUE().  Should I put the most "unique" column first, or the thing 
most easily compared on (ie the integer), or ...  What is the common 
wisdom (that I obviously don't have  ;-) ) here.  And does using "bar 
TEXT" vs "bar TEXT COLLATE NOCASE" affect the answer.  There probably 
are not easy answers here as the answer may depend on the character of 
the data in the table.


My own testing says that in the originally posed case, using "COLLATE 
NOCASE" is just a titch faster than using LIKE.


D


Igor Tandetnik wrote:

Dixon Hutchinson
 wrote:

I have an SQLite db with one TEXT column.  That column and an INTEGER
column (not the rowid as this column is definitely not unique by
itself) are declared UNIQUE together.

CREATE TABLE foo (
   bar TEXT,
   p  INTEGER,
   rowid INTEGER PRIMARY KEY AUTOINCREMENT, -- I know... this is
implicit...
   UNIQUE(p, bar)
);

All of my searches of the db when searching by the TEXT column must be
case insensitive.  So I have been using: SELECT * FROM foo WHERE bar
LIKE 'some text here';

Is that better, worse, or no different than using a "COLLATE NOCASE"
qualifier on the TEXT column and changing the "LIKE" to "="


Equality test is probably going to be somewhat faster than LIKE test 
in any case, but don't expect any dramatic time savings. Since your 
query does not use p, and p is the first field in the index, the index 
will not be used whether you use = or LIKE. If the statement you show 
is a common one and you are concerned about its performance, put 
COLLATE NOCASE on the bar column and also change the constraint to 
UNIQUE(bar, p) (or else create a separate index on bar).


Igor Tandetnik

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 





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



Re: [sqlite] case insensitivity

2006-11-28 Thread drh
Dixon Hutchinson <[EMAIL PROTECTED]> wrote:
> I have an SQLite db with one TEXT column.  That column and an INTEGER 
> column (not the rowid as this column is definitely not unique by itself) 
> are declared UNIQUE together.
> 
> CREATE TABLE foo (
> bar TEXT,
> p  INTEGER,
> rowid INTEGER PRIMARY KEY AUTOINCREMENT, -- I know... this is 
> implicit...
> UNIQUE(p, bar)
> );
> 
> All of my searches of the db when searching by the TEXT column must be 
> case insensitive.  So I have been using: SELECT * FROM foo WHERE bar 
> LIKE 'some text here';
> 
> Is that better, worse, or no different than using a "COLLATE NOCASE" 
> qualifier on the TEXT column and changing the "LIKE" to "="
> 

Using COLLATE NOCASE will be faster.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


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



Re: [sqlite] case insensitivity

2006-11-28 Thread Dennis Cote

Dixon Hutchinson wrote:
I have an SQLite db with one TEXT column.  That column and an INTEGER 
column (not the rowid as this column is definitely not unique by 
itself) are declared UNIQUE together.


CREATE TABLE foo (
   bar TEXT,
   p  INTEGER,
   rowid INTEGER PRIMARY KEY AUTOINCREMENT, -- I know... this is 
implicit...

   UNIQUE(p, bar)
);

All of my searches of the db when searching by the TEXT column must be 
case insensitive.  So I have been using: SELECT * FROM foo WHERE bar 
LIKE 'some text here';


Is that better, worse, or no different than using a "COLLATE NOCASE" 
qualifier on the TEXT column and changing the "LIKE" to "="




Dixon,

I don't think it matters much one way or the other if you use collate 
nocase or like, both involve a function call to determine the result. 
You could measure both ways to see which is faster if it is really 
important.


I would however be faster if you use the collate nocase option and 
change your unique index to reverse the order of the columns. Then 
sqlite can use that index to search for the matching strings. As it is 
now the index can't be used for a string match because equal values of 
the bar are scattered around with different value of p.


HTH
Dennis Cote


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



[sqlite] Re: case insensitivity

2006-11-28 Thread Igor Tandetnik

Dixon Hutchinson
 wrote:

I have an SQLite db with one TEXT column.  That column and an INTEGER
column (not the rowid as this column is definitely not unique by
itself) are declared UNIQUE together.

CREATE TABLE foo (
   bar TEXT,
   p  INTEGER,
   rowid INTEGER PRIMARY KEY AUTOINCREMENT, -- I know... this is
implicit...
   UNIQUE(p, bar)
);

All of my searches of the db when searching by the TEXT column must be
case insensitive.  So I have been using: SELECT * FROM foo WHERE bar
LIKE 'some text here';

Is that better, worse, or no different than using a "COLLATE NOCASE"
qualifier on the TEXT column and changing the "LIKE" to "="


Equality test is probably going to be somewhat faster than LIKE test in 
any case, but don't expect any dramatic time savings. Since your query 
does not use p, and p is the first field in the index, the index will 
not be used whether you use = or LIKE. If the statement you show is a 
common one and you are concerned about its performance, put COLLATE 
NOCASE on the bar column and also change the constraint to UNIQUE(bar, 
p) (or else create a separate index on bar).


Igor Tandetnik 



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



Re: [sqlite] C++ SQLite

2006-11-28 Thread Roberto

Check that the version of VB, or VB itself supports calling external
functions using 'cdecl' calling convention (instead of WINAPI
stdcall).

On 28/11/06, RB Smissaert <[EMAIL PROTECTED]> wrote:

Yes, that looks to be the way to do it. Basically will have to learn how to
translate C defines to VB declares.

RBS



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



[sqlite] case insensitivity

2006-11-28 Thread Dixon Hutchinson
I have an SQLite db with one TEXT column.  That column and an INTEGER 
column (not the rowid as this column is definitely not unique by itself) 
are declared UNIQUE together.


CREATE TABLE foo (
   bar TEXT,
   p  INTEGER,
   rowid INTEGER PRIMARY KEY AUTOINCREMENT, -- I know... this is 
implicit...

   UNIQUE(p, bar)
);

All of my searches of the db when searching by the TEXT column must be 
case insensitive.  So I have been using: SELECT * FROM foo WHERE bar 
LIKE 'some text here';


Is that better, worse, or no different than using a "COLLATE NOCASE" 
qualifier on the TEXT column and changing the "LIKE" to "="


D

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



Re: [sqlite] sqlite3 and threads ...

2006-11-28 Thread drh
Marten Feldtmann <[EMAIL PROTECTED]> wrote:
> I've read the book from Michael Owens about SQLite and also
> read the parts about threads and sqlite3.
> 
> Actually it seems to be possible to use the same connection
> handler from different threads - but within a transaction
> only one thread is allowed to access the library with that
> particular connection handler.

This restriction is due to problems in the way pthreads and
posix advisory locks interact in some versions of Linux with
the 2.4 kernel.  If you are using win32 or mac os-x or linux
with a 2.6 kernel, this restriction does not apply.

> 
> Is this also true for functions like "errcode" and
> "errmsg" ?

I suspect these will work regardless.

Of course, nothing will work if you using the same connection
handle in two different threads at the same time.  You may want
to put a mutex on the connection handle so that you don't try
to use the same handle at the same time in two different threads.

You best bet, in my view, is to not use threads at all.
Here is a quote (slightly modified) from Bryan Oakley that I 
saw earlier today and kind of like:

   "You almost never need threading.  A good rule of thumb
is that you don't need threading unless you *know* you
need threading.  If you only *think* you need it, you 
don't need it.  And even if you *know* you need threading,
you may not."

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


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



RE: [sqlite] C++ SQLite

2006-11-28 Thread RB Smissaert
Yes, that looks to be the way to do it. Basically will have to learn how to
translate C defines to VB declares.

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 21:58
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite

Maybe all you have to do is to make yourself a list og VB types cross 
referenced to the fundamental type used in the Win32 and Sqlite APIs. 
Then you could link any library into your VB programs.

RB Smissaert wrote:
> You might be right, but with the Win32 API you have loads of nice
> documents/programs (I like the API guide from KPD) that help you out.
> All I have to do is copy their declares straight to VB and look at the
data
> types I have to provide. Is the same available for the SQLite API?
> 
> RBS
> 
> -Original Message-
> From: John Stanton [mailto:[EMAIL PROTECTED] 
> Sent: 28 November 2006 18:43
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] C++ SQLite
> 
> If you can use the Win32 API you can use the Sqlite API.  Just because 
> they can be called from C programs does not make them "all to do with C".
> 
> RB Smissaert wrote:
> 
>>Will have a look, but I was looking for a text geared towards VB. I take
> 
> it
> 
>>the documentation that comes with SQLite is all to do with C.
>>In fact I already have a wrapper that seems to work well, the one from
>>TerraInformatica, but maybe there was more control if I could write my
> 
> own.
> 
>>RBS
>>
>>-Original Message-
>>From: Clay Dowling [mailto:[EMAIL PROTECTED] 
>>Sent: 28 November 2006 18:19
>>To: sqlite-users@sqlite.org
>>Subject: Re: [sqlite] C++ SQLite
>>
>>
>>[EMAIL PROTECTED] said:
>>
>>
>>>Thanks. Would you know any VB source code that wraps all the possible
>>>declares in a class? Or do you know where to find the documentation
>>>to make all the possible declares in VB/VBA?
>>>
>>>RBS
>>
>>
>>The SQLite documentation will give you everything you need to write the
>>wrapper.  The sqlite.h file in the source bundle would also be a great
>>help.  You may also be able to find a wrapper already written linked on
>>the SQLite web site.
>>
>>Clay Dowling
>>
>>
>>
Yes.  It's a regular windows DLL, so it will behave like all other
Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:


>Can I call the SQLite API (as in the dll SQLite.dll) directly from
>VB or do I need the wrapper? So, could it work from VB with declares
>as I use for the Windows API?
>
>RBS
>
>
>
>>sebcity wrote:
>>
>>
>>>How would one go about using c++ (Visual Studio.NET) to call and
>>>display
>>>SQLite tables. C++ wrappers?
>>
>>You should be able to call the Sqlite3 API directly.
>>
>>
>>
>>
>

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

> 
>>-
>>
>>
>>
>
>
>
>

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

> 
>>-
>>
>>
--
Simple Content Management
http://www.ceamus.com



>>
>>
>

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

>>
>>
>

> 
>>-
>>
>>

>>>
>>>
>>>
>

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

> 
>>-
>>
>>
>>
> 
> 
>

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

> -
> 
> 
> 
> 
>

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

-
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Rich Shepard

On Tue, 28 Nov 2006, Craig Morrison wrote:


I believe you are correct. I must admit I'm a bit behind on indexes as
most of the sql operations that I do are simple lookups on small datasets.


Craig,

  I'm confident that we're both correct on this.


What you have to make sure of though is that your `model_name' doesn't get
changed during the edit because that will change the `uniqueness' of the
record and thus the UNIQUE constraint never fires.


  That will not change. It's the name of the database so it's constant for
the duration of the project. Heck, if we ever want to rename it, we'll just
use the 'mv' command in the shell. :-)

Thanks,

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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



Re: [sqlite] C++ SQLite

2006-11-28 Thread John Stanton
Maybe all you have to do is to make yourself a list og VB types cross 
referenced to the fundamental type used in the Win32 and Sqlite APIs. 
Then you could link any library into your VB programs.


RB Smissaert wrote:

You might be right, but with the Win32 API you have loads of nice
documents/programs (I like the API guide from KPD) that help you out.
All I have to do is copy their declares straight to VB and look at the data
types I have to provide. Is the same available for the SQLite API?

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:43

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite

If you can use the Win32 API you can use the Sqlite API.  Just because 
they can be called from C programs does not make them "all to do with C".


RB Smissaert wrote:


Will have a look, but I was looking for a text geared towards VB. I take


it


the documentation that comes with SQLite is all to do with C.
In fact I already have a wrapper that seems to work well, the one from
TerraInformatica, but maybe there was more control if I could write my


own.


RBS

-Original Message-
From: Clay Dowling [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:19

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite


[EMAIL PROTECTED] said:



Thanks. Would you know any VB source code that wraps all the possible
declares in a class? Or do you know where to find the documentation
to make all the possible declares in VB/VBA?

RBS



The SQLite documentation will give you everything you need to write the
wrapper.  The sqlite.h file in the source bundle would also be a great
help.  You may also be able to find a wrapper already written linked on
the SQLite web site.

Clay Dowling




Yes.  It's a regular windows DLL, so it will behave like all other
Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:



Can I call the SQLite API (as in the dll SQLite.dll) directly from
VB or do I need the wrapper? So, could it work from VB with declares
as I use for the Windows API?

RBS




sebcity wrote:



How would one go about using c++ (Visual Studio.NET) to call and
display
SQLite tables. C++ wrappers?


You should be able to call the Sqlite3 API directly.









-



To unsubscribe, send email to [EMAIL PROTECTED]








-












-



To unsubscribe, send email to [EMAIL PROTECTED]








-



--
Simple Content Management
http://www.ceamus.com










-



To unsubscribe, send email to [EMAIL PROTECTED]








-












-



To unsubscribe, send email to [EMAIL PROTECTED]








-







-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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




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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Craig Morrison

Rich Shepard wrote:

On Tue, 28 Nov 2006, Craig Morrison wrote:


Another method is to have a field declared UNIQUE and use the syntax:

INSERT OR REPLACE INTO table ...

The UNIQUE constraint will trigger the REPLACE constraint if it 
already exists and the row will get updated instead of inserted.


Craig,

  What I'm working on now is the general project database description. The
schema for table 'model' is:

CREATE TABLE model (model_name text not null primary key, model_desc text,
model_type text, keName text, agent INTEGER);
CREATE INDEX model_name_idx on model (model_name);

  The index is, I believe, redundant as the column is the primary key so
it's both unique and indexed.


I believe you are correct. I must admit I'm a bit behind on indexes as 
most of the sql operations that I do are simple lookups on small datasets.


Maybe one of the other gurus can chime in here and offer more insight.


  Do I need to specify each field as unique for this to work? Perhaps part
of my problem is that I'm not getting the database connection to work
properly so I cannot test it in real time. One step at a time.


No, you don't.

What you have to make sure of though is that your `model_name' doesn't 
get changed during the edit because that will change the `uniqueness' of 
the record and thus the UNIQUE constraint never fires.


Since model_name is your index and it is the unique or defining 
characteristic of each row its contents must not change after being 
inserted for an update to occur. If you must change the model_name, then 
you are delegated to "delete and reinsert" the record.


--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://pse.2cah.com
  Controlling pseudoephedrine purchases.

http://www.mtsprofessional.com/
  A Win32 email server that works for You.

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



RE: [sqlite] C++ SQLite

2006-11-28 Thread RB Smissaert
> In the amount of time that you've spent asking for an import
> library on this list you could have written all of the imports.

If you say so. Thanks in any case.

RBS

-Original Message-
From: Clay Dowling [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 21:39
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] C++ SQLite


RB Smissaert said:
> You might be right, but with the Win32 API you have loads of nice
> documents/programs (I like the API guide from KPD) that help you out.
> All I have to do is copy their declares straight to VB and look at the
> data
> types I have to provide. Is the same available for the SQLite API?
>

http://www.sqlite.org/capi3ref.html

That's the page you want.  It declares everything you need.  In the amount
of time that you've spent asking for an import library on this list you
could have written all of the imports.

The sqlite3* and sqlite3_stmt* types are just pointers, so you can declare
them as such.  Everything else is a fundamental type.  Now you're good to
go.  Combine that with my article in a previous message about how to use
the API and you're on the same footing as the C programmers who use the
library.

Clay Dowling



> -Original Message-
> From: John Stanton [mailto:[EMAIL PROTECTED]
> Sent: 28 November 2006 18:43
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] C++ SQLite
>
> If you can use the Win32 API you can use the Sqlite API.  Just because
> they can be called from C programs does not make them "all to do with C".
>
> RB Smissaert wrote:
>> Will have a look, but I was looking for a text geared towards VB. I take
> it
>> the documentation that comes with SQLite is all to do with C.
>> In fact I already have a wrapper that seems to work well, the one from
>> TerraInformatica, but maybe there was more control if I could write my
> own.
>>
>> RBS
>>
>> -Original Message-
>> From: Clay Dowling [mailto:[EMAIL PROTECTED]
>> Sent: 28 November 2006 18:19
>> To: sqlite-users@sqlite.org
>> Subject: Re: [sqlite] C++ SQLite
>>
>>
>> [EMAIL PROTECTED] said:
>>
>>>Thanks. Would you know any VB source code that wraps all the possible
>>>declares in a class? Or do you know where to find the documentation
>>>to make all the possible declares in VB/VBA?
>>>
>>>RBS
>>
>>
>> The SQLite documentation will give you everything you need to write the
>> wrapper.  The sqlite.h file in the source bundle would also be a great
>> help.  You may also be able to find a wrapper already written linked on
>> the SQLite web site.
>>
>> Clay Dowling
>>
>>
>>>
Yes.  It's a regular windows DLL, so it will behave like all other
Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:

>Can I call the SQLite API (as in the dll SQLite.dll) directly from
>VB or do I need the wrapper? So, could it work from VB with declares
>as I use for the Windows API?
>
>RBS
>
>
>>sebcity wrote:
>>
>>>How would one go about using c++ (Visual Studio.NET) to call and
>>>display
>>>SQLite tables. C++ wrappers?
>>
>>You should be able to call the Sqlite3 API directly.
>>
>>
>>
>>
>

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

>> -
>>
>>
>>
>
>
>
>
>>
>

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

>> -
>>
>

--
Simple Content Management
http://www.ceamus.com



>>
>>
>

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

>>
>>
>

>> -
>>


>>>
>>>
>>>
>>>
>>
>

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

>> -
>>
>>>
>>
>>
>
>
>

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

> -
>
>
>
>
>

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

-
>
>


-- 
Simple Content Management
http://www.ceamus.com



-
To unsubscribe, send email to [EMAIL PROTECTED]

-





[sqlite] sqlite3 and threads ...

2006-11-28 Thread Marten Feldtmann

I've read the book from Michael Owens about SQLite and also
read the parts about threads and sqlite3.

Actually it seems to be possible to use the same connection
handler from different threads - but within a transaction
only one thread is allowed to access the library with that
particular connection handler.

Is this also true for functions like "errcode" and
"errmsg" ?

Background: I'm writing a wrapper for VASmalltalk and in that
tool it is possible to execute an external API call with a feature
named "staticFuture" call (an API call is always done with the
same native thread) - but this feature is time consuming.

After that costly API call I would like to call the fast API calls
"errcode" and "errmsg" in the virtual machine thread (which is
a different native thread than the thread mentioned above).

Is that possible ?

Marten

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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Isaac Raway

On 11/28/06, Nicolas Williams <[EMAIL PROTECTED]> wrote:

On Tue, Nov 28, 2006 at 03:03:58PM -0600, Isaac Raway wrote:
> Use an index on the table with your key values and call "INSERT OR
> UPDATE INTO t(...) VALUES(...)" for all creation and update
> operations. Unless you're dealing with a tremendous amount of data per
> record this will be perfectly efficient.

Surely you mean INSERT OR REPLACE ...
  ^^^

Actually... yes. Not sure what version of SQL I was thinking of.
Probably the one in my head.

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



RE: [sqlite] C++ SQLite

2006-11-28 Thread Clay Dowling

RB Smissaert said:
> You might be right, but with the Win32 API you have loads of nice
> documents/programs (I like the API guide from KPD) that help you out.
> All I have to do is copy their declares straight to VB and look at the
> data
> types I have to provide. Is the same available for the SQLite API?
>

http://www.sqlite.org/capi3ref.html

That's the page you want.  It declares everything you need.  In the amount
of time that you've spent asking for an import library on this list you
could have written all of the imports.

The sqlite3* and sqlite3_stmt* types are just pointers, so you can declare
them as such.  Everything else is a fundamental type.  Now you're good to
go.  Combine that with my article in a previous message about how to use
the API and you're on the same footing as the C programmers who use the
library.

Clay Dowling



> -Original Message-
> From: John Stanton [mailto:[EMAIL PROTECTED]
> Sent: 28 November 2006 18:43
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] C++ SQLite
>
> If you can use the Win32 API you can use the Sqlite API.  Just because
> they can be called from C programs does not make them "all to do with C".
>
> RB Smissaert wrote:
>> Will have a look, but I was looking for a text geared towards VB. I take
> it
>> the documentation that comes with SQLite is all to do with C.
>> In fact I already have a wrapper that seems to work well, the one from
>> TerraInformatica, but maybe there was more control if I could write my
> own.
>>
>> RBS
>>
>> -Original Message-
>> From: Clay Dowling [mailto:[EMAIL PROTECTED]
>> Sent: 28 November 2006 18:19
>> To: sqlite-users@sqlite.org
>> Subject: Re: [sqlite] C++ SQLite
>>
>>
>> [EMAIL PROTECTED] said:
>>
>>>Thanks. Would you know any VB source code that wraps all the possible
>>>declares in a class? Or do you know where to find the documentation
>>>to make all the possible declares in VB/VBA?
>>>
>>>RBS
>>
>>
>> The SQLite documentation will give you everything you need to write the
>> wrapper.  The sqlite.h file in the source bundle would also be a great
>> help.  You may also be able to find a wrapper already written linked on
>> the SQLite web site.
>>
>> Clay Dowling
>>
>>
>>>
Yes.  It's a regular windows DLL, so it will behave like all other
Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:

>Can I call the SQLite API (as in the dll SQLite.dll) directly from
>VB or do I need the wrapper? So, could it work from VB with declares
>as I use for the Windows API?
>
>RBS
>
>
>>sebcity wrote:
>>
>>>How would one go about using c++ (Visual Studio.NET) to call and
>>>display
>>>SQLite tables. C++ wrappers?
>>
>>You should be able to call the Sqlite3 API directly.
>>
>>
>>
>>
> 
>> -
>>
>>To unsubscribe, send email to [EMAIL PROTECTED]
>>
>>
>>
> 
>> -
>>
>>
>>
>
>
>
>
>>
> 
>> -
>>
>To unsubscribe, send email to [EMAIL PROTECTED]
>
>>
>>
> 
>> -
>>
>

--
Simple Content Management
http://www.ceamus.com



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

>>
>>
> 
>> -
>>


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


-- 
Simple Content Management
http://www.ceamus.com


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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Rich Shepard

On Tue, 28 Nov 2006, Craig Morrison wrote:


Another method is to have a field declared UNIQUE and use the syntax:

INSERT OR REPLACE INTO table ...

The UNIQUE constraint will trigger the REPLACE constraint if it already 
exists and the row will get updated instead of inserted.


Craig,

  What I'm working on now is the general project database description. The
schema for table 'model' is:

CREATE TABLE model (model_name text not null primary key, model_desc text,
model_type text, keName text, agent INTEGER);
CREATE INDEX model_name_idx on model (model_name);

  The index is, I believe, redundant as the column is the primary key so
it's both unique and indexed.

  Do I need to specify each field as unique for this to work? Perhaps part
of my problem is that I'm not getting the database connection to work
properly so I cannot test it in real time. One step at a time.

Thanks,

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Rich Shepard

On Tue, 28 Nov 2006, Isaac Raway wrote:


Use an index on the table with your key values and call "INSERT OR UPDATE
INTO t(...) VALUES(...)" for all creation and update operations. Unless
you're dealing with a tremendous amount of data per record this will be
perfectly efficient.


Isaac,

  I totally forgot about that! I recall reading about it in Mike Owens'
book, but could not find it when I went through it looking for a solution.

Many thanks,

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Nicolas Williams
On Tue, Nov 28, 2006 at 03:03:58PM -0600, Isaac Raway wrote:
> Use an index on the table with your key values and call "INSERT OR
> UPDATE INTO t(...) VALUES(...)" for all creation and update
> operations. Unless you're dealing with a tremendous amount of data per
> record this will be perfectly efficient.

Surely you mean INSERT OR REPLACE ...
  ^^^


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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Craig Morrison

Rich Shepard wrote:

  What is the most efficient approach to test whether a record has a value
in a field that's different from the one displayed? The only approach that
occurs to me is to retrieve each field from the table and compare values
with those in the form when the "Save" button is clicked. If the field is
blank, then use an 'insert' statement; if the field has an existing value,
use an 'update' statement. Seems kludgy to me.


Kludgy but works.

Another method is to have a field declared UNIQUE and use the syntax:

 INSERT OR REPLACE INTO table ...

The UNIQUE constraint will trigger the REPLACE constraint if it already 
exists and the row will get updated instead of inserted.


--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://pse.2cah.com
  Controlling pseudoephedrine purchases.

http://www.mtsprofessional.com/
  A Win32 email server that works for You.

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



Re: [sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Isaac Raway

Use an index on the table with your key values and call "INSERT OR
UPDATE INTO t(...) VALUES(...)" for all creation and update
operations. Unless you're dealing with a tremendous amount of data per
record this will be perfectly efficient.

On 11/28/06, Rich Shepard <[EMAIL PROTECTED]> wrote:

   This is a generic approach question, not neccesarily tied to a specific
database and certainly not to a particular language. For context, however,
my application is written in python and C and uses sqlite3. Here's the
situation:

   A database is created or opened, and the user enters data via fields on a
form. These data are then saved by inserting into the appropirate table and
fields. Now, if the user goes back to some of the fields and changes the
values in them, the table row should be updated, not re-inserted.

   What is the most efficient approach to test whether a record has a value
in a field that's different from the one displayed? The only approach that
occurs to me is to retrieve each field from the table and compare values
with those in the form when the "Save" button is clicked. If the field is
blank, then use an 'insert' statement; if the field has an existing value,
use an 'update' statement. Seems kludgy to me.

   Interestingly, I've not encounted this before with any database
application I've written, because they were all done in discrete steps. That
is, a menu was used to select whether new data were to be entered, or if
existing data were to be modified. With an event-driven GUI engine, and the
ability to modify the values in the widgets, it's a brand new game for me.

Thanks,

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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





--
Isaac Raway
Entia non sunt multiplicanda praeter necessitatem.

http://blueapples.org - blog
http://stonenotes.com - personal knowledge management

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



[sqlite] Accommodating 'Insert' and 'Update'

2006-11-28 Thread Rich Shepard

  This is a generic approach question, not neccesarily tied to a specific
database and certainly not to a particular language. For context, however,
my application is written in python and C and uses sqlite3. Here's the
situation:

  A database is created or opened, and the user enters data via fields on a
form. These data are then saved by inserting into the appropirate table and
fields. Now, if the user goes back to some of the fields and changes the
values in them, the table row should be updated, not re-inserted.

  What is the most efficient approach to test whether a record has a value
in a field that's different from the one displayed? The only approach that
occurs to me is to retrieve each field from the table and compare values
with those in the form when the "Save" button is clicked. If the field is
blank, then use an 'insert' statement; if the field has an existing value,
use an 'update' statement. Seems kludgy to me.

  Interestingly, I've not encounted this before with any database
application I've written, because they were all done in discrete steps. That
is, a menu was used to select whether new data were to be entered, or if
existing data were to be modified. With an event-driven GUI engine, and the
ability to modify the values in the widgets, it's a brand new game for me.

Thanks,

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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



RE: [sqlite] C++ SQLite

2006-11-28 Thread RB Smissaert
You might be right, but with the Win32 API you have loads of nice
documents/programs (I like the API guide from KPD) that help you out.
All I have to do is copy their declares straight to VB and look at the data
types I have to provide. Is the same available for the SQLite API?

RBS

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:43
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite

If you can use the Win32 API you can use the Sqlite API.  Just because 
they can be called from C programs does not make them "all to do with C".

RB Smissaert wrote:
> Will have a look, but I was looking for a text geared towards VB. I take
it
> the documentation that comes with SQLite is all to do with C.
> In fact I already have a wrapper that seems to work well, the one from
> TerraInformatica, but maybe there was more control if I could write my
own.
> 
> RBS
> 
> -Original Message-
> From: Clay Dowling [mailto:[EMAIL PROTECTED] 
> Sent: 28 November 2006 18:19
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] C++ SQLite
> 
> 
> [EMAIL PROTECTED] said:
> 
>>Thanks. Would you know any VB source code that wraps all the possible
>>declares in a class? Or do you know where to find the documentation
>>to make all the possible declares in VB/VBA?
>>
>>RBS
> 
> 
> The SQLite documentation will give you everything you need to write the
> wrapper.  The sqlite.h file in the source bundle would also be a great
> help.  You may also be able to find a wrapper already written linked on
> the SQLite web site.
> 
> Clay Dowling
> 
> 
>>
>>>Yes.  It's a regular windows DLL, so it will behave like all other
>>>Windows
>>>DLLs.
>>>
>>>Clay Dowling
>>>
>>>[EMAIL PROTECTED] said:
>>>
Can I call the SQLite API (as in the dll SQLite.dll) directly from
VB or do I need the wrapper? So, could it work from VB with declares
as I use for the Windows API?

RBS


>sebcity wrote:
>
>>How would one go about using c++ (Visual Studio.NET) to call and
>>display
>>SQLite tables. C++ wrappers?
>
>You should be able to call the Sqlite3 API directly.
>
>
> 
>

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

> -
> 
>
>




>

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

> 
>

> -
> 

>>>
>>>--
>>>Simple Content Management
>>>http://www.ceamus.com
>>>
>>>
>>>
> 
>

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

> -
> 
>>>
>>>
>>
>>
>>
>>
>

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

> -
> 
>>
> 
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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



Re: [sqlite] Roll-back

2006-11-28 Thread Benedetta . Turchi
Yes,  it worked after I added 'begin' and 'end' at the beginning and at 
the end of my transaction:

db.exec("begin;"+
"select * from t1; " +
   "delete from t1 where t1key = 1; " +
   "insert into t1(data,num) values('Speedy', 3); " +
   "select * from t1;"+
   "select * from t106;"+
   "end;", cb);

db.exec("rollback", cb);

Thanks

Benedetta Turchi
Engineering Tools
Engineering Tools Website 



John Stanton <[EMAIL PROTECTED]> 
28/11/2006 18:14
Please respond to
sqlite-users@sqlite.org


To
sqlite-users@sqlite.org
cc

Subject
Re: [sqlite] Roll-back






That should not stop you from starting a transaction and committing it.

Note that Sqlite will automatically wrap your SQL in a transaction is 
you don't specify one.

[EMAIL PROTECTED] wrote:
> Thanks, but  the problem is that I am using this SQLite Java Wrapper 
> library:
>  http://www.ch-werner.de/javasqlite/
> 
> and it looks like the only way I have to execute sql statements is to 
use 
> the following commands:
> - Database.compile()
> - Database.exec()
> 
> unfortunately no roll-back
> 
> Benedetta Turchi
> Engineering Tools
> Engineering Tools Website 
> 
> 
> 
> John Stanton <[EMAIL PROTECTED]> 
> 28/11/2006 17:12
> Please respond to
> sqlite-users@sqlite.org
> 
> 
> To
> sqlite-users@sqlite.org
> cc
> 
> Subject
> Re: [sqlite] Roll-back
> 
> 
> 
> 
> 
> 
> Issue ROLLBACK instead of COMMIT for your transaction.  If you have 
> already issued COMMIT it is too late.
> 
> [EMAIL PROTECTED] wrote:
> 
>>Hi,
>>
>>how can I 'roll-back' some modifications done by some previous sql 
>>statements with SQLite?
>>
>>Thank you
>>
>>Benedetta Turchi
>>Engineering Tools
>>Engineering Tools Website 
>>
>>
>>
>>
>>-
>>***
>>*** Symbian Software Ltd is a company registered in England and
>>Wales with registered number 4190020 and registered office at 2-6
>>Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
>>intended only for use by the named addressee and may contain
>>privileged and/or confidential information. If you are not the
>>named addressee you should not disseminate, copy or take any action
>>in reliance on it. If you have received this message in error
>>please notify [EMAIL PROTECTED] and delete the message and any
>>attachments accompanying it immediately. Neither Symbian nor any of
>>its Affiliates accepts liability for any corruption, interception,
>>amendment, tampering or viruses occurring to this message in
>>transit or for any message sent by its employees which is not in
>>compliance with Symbian corporate policy. *
>>*
>>
> 
> 
> 
> 
-
> To unsubscribe, send email to [EMAIL PROTECTED]
> 
-
> 
> 
> 
> 
> 
> -
> ***
> *** Symbian Software Ltd is a company registered in England and
> Wales with registered number 4190020 and registered office at 2-6
> Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
> intended only for use by the named addressee and may contain
> privileged and/or confidential information. If you are not the
> named addressee you should not disseminate, copy or take any action
> in reliance on it. If you have received this message in error
> please notify [EMAIL PROTECTED] and delete the message and any
> attachments accompanying it immediately. Neither Symbian nor any of
> its Affiliates accepts liability for any corruption, interception,
> amendment, tampering or viruses occurring to this message in
> transit or for any message sent by its employees which is not in
> compliance with Symbian corporate policy. *
> *
> 


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





-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it 

Re: [sqlite] C++ SQLite

2006-11-28 Thread John Stanton
If you can use the Win32 API you can use the Sqlite API.  Just because 
they can be called from C programs does not make them "all to do with C".


RB Smissaert wrote:

Will have a look, but I was looking for a text geared towards VB. I take it
the documentation that comes with SQLite is all to do with C.
In fact I already have a wrapper that seems to work well, the one from
TerraInformatica, but maybe there was more control if I could write my own.

RBS

-Original Message-
From: Clay Dowling [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:19

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite


[EMAIL PROTECTED] said:


Thanks. Would you know any VB source code that wraps all the possible
declares in a class? Or do you know where to find the documentation
to make all the possible declares in VB/VBA?

RBS



The SQLite documentation will give you everything you need to write the
wrapper.  The sqlite.h file in the source bundle would also be a great
help.  You may also be able to find a wrapper already written linked on
the SQLite web site.

Clay Dowling





Yes.  It's a regular windows DLL, so it will behave like all other
Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:


Can I call the SQLite API (as in the dll SQLite.dll) directly from
VB or do I need the wrapper? So, could it work from VB with declares
as I use for the Windows API?

RBS



sebcity wrote:


How would one go about using c++ (Visual Studio.NET) to call and
display
SQLite tables. C++ wrappers?


You should be able to call the Sqlite3 API directly.





-


To unsubscribe, send email to [EMAIL PROTECTED]




-











-


To unsubscribe, send email to [EMAIL PROTECTED]




-





--
Simple Content Management
http://www.ceamus.com






-


To unsubscribe, send email to [EMAIL PROTECTED]




-











-


To unsubscribe, send email to [EMAIL PROTECTED]




-









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



RE: [sqlite] C++ SQLite

2006-11-28 Thread RB Smissaert
Will have a look, but I was looking for a text geared towards VB. I take it
the documentation that comes with SQLite is all to do with C.
In fact I already have a wrapper that seems to work well, the one from
TerraInformatica, but maybe there was more control if I could write my own.

RBS

-Original Message-
From: Clay Dowling [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2006 18:19
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ SQLite


[EMAIL PROTECTED] said:
> Thanks. Would you know any VB source code that wraps all the possible
> declares in a class? Or do you know where to find the documentation
> to make all the possible declares in VB/VBA?
>
> RBS

The SQLite documentation will give you everything you need to write the
wrapper.  The sqlite.h file in the source bundle would also be a great
help.  You may also be able to find a wrapper already written linked on
the SQLite web site.

Clay Dowling

>
>
>> Yes.  It's a regular windows DLL, so it will behave like all other
>> Windows
>> DLLs.
>>
>> Clay Dowling
>>
>> [EMAIL PROTECTED] said:
>>> Can I call the SQLite API (as in the dll SQLite.dll) directly from
>>> VB or do I need the wrapper? So, could it work from VB with declares
>>> as I use for the Windows API?
>>>
>>> RBS
>>>
 sebcity wrote:
> How would one go about using c++ (Visual Studio.NET) to call and
> display
> SQLite tables. C++ wrappers?
 You should be able to call the Sqlite3 API directly.



-
 To unsubscribe, send email to [EMAIL PROTECTED]


-



>>>
>>>
>>>
>>>
>>>

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

-
>>>
>>>
>>
>>
>> --
>> Simple Content Management
>> http://www.ceamus.com
>>
>>
>>

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

-
>>
>>
>>
>
>
>
>
>

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

-
>
>


-- 
Simple Content Management
http://www.ceamus.com



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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



Re: [sqlite] Roll-back

2006-11-28 Thread John Stanton

That should not stop you from starting a transaction and committing it.

Note that Sqlite will automatically wrap your SQL in a transaction is 
you don't specify one.


[EMAIL PROTECTED] wrote:
Thanks, but  the problem is that I am using this SQLite Java Wrapper 
library:

 http://www.ch-werner.de/javasqlite/

and it looks like the only way I have to execute sql statements is to use 
the following commands:

- Database.compile()
- Database.exec()

unfortunately no roll-back

Benedetta Turchi
Engineering Tools
Engineering Tools Website 




John Stanton <[EMAIL PROTECTED]> 
28/11/2006 17:12

Please respond to
sqlite-users@sqlite.org


To
sqlite-users@sqlite.org
cc

Subject
Re: [sqlite] Roll-back






Issue ROLLBACK instead of COMMIT for your transaction.  If you have 
already issued COMMIT it is too late.


[EMAIL PROTECTED] wrote:


Hi,

how can I 'roll-back' some modifications done by some previous sql 
statements with SQLite?


Thank you

Benedetta Turchi
Engineering Tools
Engineering Tools Website 





-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it immediately. Neither Symbian nor any of
its Affiliates accepts liability for any corruption, interception,
amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in
compliance with Symbian corporate policy. *
*





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





-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it immediately. Neither Symbian nor any of
its Affiliates accepts liability for any corruption, interception,
amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in
compliance with Symbian corporate policy. *
*




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



Re: [sqlite] Time formatting

2006-11-28 Thread Dennis Cote

Karthick V - TLS , Chennai wrote:

Hi everyone,
 
I am trying to generate a time information with the time zone offset

information in the UTC format
 
-MM-DDTHH:MM:SS.mmm+HH:MM
 
  

Try this:

   select strftime('%Y-%m-%dT%H:%M:%f', 'now', 'localtime') ||
   case
   when strftime('%H:%M', '12:00', 'localtime') < '12:00'
   then strftime('-%H:%M', '00:00', 'utc')
   else strftime('+%H:%M', '00:00', 'utc')
   end;

When I run this here I get:

   2006-11-28T10:29:51.091-07:00

Which is the correct timezone offset for MST.

HTH
Dennis Cote



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



Re: [sqlite] Roll-back

2006-11-28 Thread Benedetta . Turchi
Thanks, but  the problem is that I am using this SQLite Java Wrapper 
library:
 http://www.ch-werner.de/javasqlite/

and it looks like the only way I have to execute sql statements is to use 
the following commands:
- Database.compile()
- Database.exec()

unfortunately no roll-back

Benedetta Turchi
Engineering Tools
Engineering Tools Website 



John Stanton <[EMAIL PROTECTED]> 
28/11/2006 17:12
Please respond to
sqlite-users@sqlite.org


To
sqlite-users@sqlite.org
cc

Subject
Re: [sqlite] Roll-back






Issue ROLLBACK instead of COMMIT for your transaction.  If you have 
already issued COMMIT it is too late.

[EMAIL PROTECTED] wrote:
> Hi,
> 
> how can I 'roll-back' some modifications done by some previous sql 
> statements with SQLite?
> 
> Thank you
> 
> Benedetta Turchi
> Engineering Tools
> Engineering Tools Website 
> 
> 
> 
> 
> -
> ***
> *** Symbian Software Ltd is a company registered in England and
> Wales with registered number 4190020 and registered office at 2-6
> Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
> intended only for use by the named addressee and may contain
> privileged and/or confidential information. If you are not the
> named addressee you should not disseminate, copy or take any action
> in reliance on it. If you have received this message in error
> please notify [EMAIL PROTECTED] and delete the message and any
> attachments accompanying it immediately. Neither Symbian nor any of
> its Affiliates accepts liability for any corruption, interception,
> amendment, tampering or viruses occurring to this message in
> transit or for any message sent by its employees which is not in
> compliance with Symbian corporate policy. *
> *
> 


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





-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it immediately. Neither Symbian nor any of
its Affiliates accepts liability for any corruption, interception,
amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in
compliance with Symbian corporate policy. *
*


Re: [sqlite] Saving tables

2006-11-28 Thread John Stanton
Extensions are used by such systems as MIME to indicate file type. 
Fitting into those conventions is better than not doing so for some 
capricious reason.


Name extensions are easier to handle than the traditional Unix "magic" 
method.


Trevor Talbot wrote:

On 11/28/06, John Stanton <[EMAIL PROTECTED]> wrote:


If you use an extension greater than 3 chars you violate rules for some
existing file systems and reduce portability.  You can also make it
difficult to parse the extension when it is used to type the file.



The journal filename violates most of the same constraints, so that's
not much of an argument :P

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






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



Re: [sqlite] Roll-back

2006-11-28 Thread John Stanton
Issue ROLLBACK instead of COMMIT for your transaction.  If you have 
already issued COMMIT it is too late.


[EMAIL PROTECTED] wrote:

Hi,

how can I 'roll-back' some modifications done by some previous sql 
statements with SQLite?


Thank you

Benedetta Turchi
Engineering Tools
Engineering Tools Website 





-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it immediately. Neither Symbian nor any of
its Affiliates accepts liability for any corruption, interception,
amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in
compliance with Symbian corporate policy. *
*




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



Re: [sqlite] OT: filenaming conventions -- was: Re: [sqlite] Saving tables

2006-11-28 Thread Trevor Talbot

On 11/28/06, P Kishor <[EMAIL PROTECTED]> wrote:

On 11/28/06, Craig Morrison <[EMAIL PROTECTED]> wrote:



> Just a bit of warning, as it has bitten a few in the bum, about >3
> character extensions under the NT+ variants.. They can and will bite
> you, for instance:
>
> dir *.sql
>
> Will list not only *.sql files, but *.sqlite too.
>
> Imagine:
>
> del *.sql



fair warning, but totally pointless --

'del *.s*' will delete all your sql files as well, and so will 'del
*.??l*' and and host of other variations. There are many ways of
harming oneself, but picking on arbitrarily long extensions as a
particularly dangerous one is baseless, afaik.


Note the lack of a trailing wildcard in his example.  That was not a typo.

The issue there is due to short filenames being matched; the related
configuration setting is documented here:
http://support.microsoft.com/kb/164351


Recently, I read somewhere (forget the link... should be easy to
search for) -- apparently some file extensions are registered within
Windows as special files that need to be indexed on every change. One
of those extensions is '.dbd' (I could be wrong about the particular
extension... but, for the sake of argument, let's just assume it is
'.dbd'). So, every time your database changes even a little bit, the
OS wants to index it... this person who discovered this phenomenon,
claimed it was causing a performance bottleneck.


Windows XP's System Restore tracks and journals the contents of
certain filetypes in realtime.  I don't have a link for the filetypes
handy though.  There's a similar issue with some of the desktop search
applications trying to index file contents.


Whether or not this is true, the fact is, in Windows (and even in Mac
OS X, while using the Finder), three letter extensions mean something
special. By making it '.sqlite' (or '.bobbitybob', for that matter), I
hope to make my db immune from all this. Actually, even better might
be not having any extension at all.


It's not that 3 letter extensions in the abstract are special (both
OSes can handle extensions of any length), it's just that most of the
logical 1-3 letter extensions have already been used by someone else.

I tend to choose long extensions for the same reason.

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



Re: [sqlite] Music Files

2006-11-28 Thread John Stanton
Here are a couple of links to get you started.  I suggest you google 
your way until you find something which suits you.


http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers
http://www.freevbcode.com/ShowCode.asp?ID=6893

made hendra wrote:

Thanks John,
Btw, i'm not a sqlite advance nor vb.
I'm not fully understand about vb wrapper. I always using ODBC to
create database connection. Any suggest or clue? where i can find vb
wrapper for sqlite(3).



Tuesday, November 28, 2006, 11:11:04 PM, you wrote:



I cannot help you with ODBC, but if you have an embedded sqlite database
you may be much better off to use the Sqlite API directly rather
than SQL/CLI (ODBC).  The Sqlite API handles BLOBs very effectively.



Even if you use something like VB you can find an interface (wrapper) 
for the Sqlite API which will work effectively.



You should be aware that Sqlite is not a DBMS server like Sql Server, 
Oracle or DB2, it is a library of routines to embed in your application.

 If you use it that way the ODBC route does not make much sense and you
lose much of the simplicity of Sqlite.




An Sqlite database is just a single file, so you can see how simple that
makes managing your application.  Backups and recovery are so simple. 
Distribution of databases cannot be simpler.




Best Regards,
made hendra


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




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



Re: [sqlite] Saving tables

2006-11-28 Thread Trevor Talbot

On 11/28/06, John Stanton <[EMAIL PROTECTED]> wrote:


If you use an extension greater than 3 chars you violate rules for some
existing file systems and reduce portability.  You can also make it
difficult to parse the extension when it is used to type the file.


The journal filename violates most of the same constraints, so that's
not much of an argument :P

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



Re: [sqlite] Roll-back

2006-11-28 Thread drh
[EMAIL PROTECTED] wrote:
> Hi,
> 
> how can I 'roll-back' some modifications done by some previous sql 
> statements with SQLite?
> 

The ROLLBACK command will undo everything from within a
transaction, assuming you have not already committed the
transaction.  Once a transaction commits, there is no
built-in way to undo it.  You'll have to invent an
application-specific undo mechanism in that case.

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


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



Re: [sqlite] Saving tables

2006-11-28 Thread Trevor Talbot

On 11/28/06, sebcity <[EMAIL PROTECTED]> wrote:


Where do you execute the SQLite program from?
Is it just the sqlite.exe file?


You need to start from your OS command prompt; run "sqlite3
database.filename" from there.  Do not double-click sqlite3.exe.

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



Re: [sqlite] OT: filenaming conventions -- was: Re: [sqlite] Saving tables

2006-11-28 Thread Will Leshner

On 11/28/06, P Kishor <[EMAIL PROTECTED]> wrote:


Whether or not this is true, the fact is, in Windows (and even in Mac
OS X, while using the Finder), three letter extensions mean something
special. By making it '.sqlite' (or '.bobbitybob', for that matter), I
hope to make my db immune from all this. Actually, even better might
be not having any extension at all.


Actually, Mac OS X (and that includes the Finder) has no restriction
on the length of the extension. Many applications use very long
extensions, in fact.

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



[sqlite] Time formatting

2006-11-28 Thread Karthick V - TLS , Chennai
Hi everyone,
 
I am trying to generate a time information with the time zone offset
information in the UTC format
 
-MM-DDTHH:MM:SS.mmm+HH:MM
 
with the last HH and MM referring to the offset of the timezone hours and
minutes from the GMT. My table is created using the following queries
 
CREATE TABLE TwoTimes(localTime datetime, GMTTime datetime);
 
Rows are inserted using the following sql statement
insert into twoTimes(localtime,gmttime)
values(strftime('%Y-%m-%dT%H:%M:%f','now','localtime'),strftime('%Y-%m-%dT%H
:%M:%f','now','utc','+5 minutes'));
 
 
I have written a query of this type to get most of the information.
 
select strftime('%Y-%m-%dT%H:%M:%f',localtime) ||
quote((strftime('%s',localtime) - strftime('%s',gmttime))/3600) || ':' ||
quote((abs((strftime('%s',localtime) - strftime('%s',gmttime)))%3600)/60)
from twotimes

I have the problem of getting the "+" sign ('-' comes through the
calculation itself) and having two digit Hours and minutes for the timezone
offset. 
 
Anyone has done a similar method of implementing. 
 
With Regards
 
Karthick V
HCL Technologies Limited, 
Chennai, India

 
"The secret of being miserable is to have leisure to bother about whether
you are happy or not.  The cure for it is occupation."
George Bernard Shaw (1856-1950)
 
DISCLAIMER 
The contents of this e-mail and any attachment(s) are confidential and intended 
for the 

named recipient(s) only. It shall not attach any liability on the originator or 
HCL or its 

affiliates. Any views or opinions presented in this email are solely those of 
the author and 

may not necessarily reflect the opinions of HCL or its affiliates. Any form of 
reproduction, 

dissemination, copying, disclosure, modification, distribution and / or 
publication of this 

message without the prior written consent of the author of this e-mail is 
strictly 

prohibited. If you have received this email in error please delete it and 
notify the sender 

immediately. Before opening any mail and attachments please check them for 
viruses and 

defect.


Re: [sqlite] C++ SQLite

2006-11-28 Thread Clay Dowling
Yes.  It's a regular windows DLL, so it will behave like all other Windows
DLLs.

Clay Dowling

[EMAIL PROTECTED] said:
> Can I call the SQLite API (as in the dll SQLite.dll) directly from
> VB or do I need the wrapper? So, could it work from VB with declares
> as I use for the Windows API?
>
> RBS
>
>> sebcity wrote:
>>> How would one go about using c++ (Visual Studio.NET) to call and
>>> display
>>> SQLite tables. C++ wrappers?
>> You should be able to call the Sqlite3 API directly.
>>
>> -
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> -
>>
>>
>>
>
>
>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>


-- 
Simple Content Management
http://www.ceamus.com


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



[sqlite] Roll-back

2006-11-28 Thread Benedetta . Turchi
Hi,

how can I 'roll-back' some modifications done by some previous sql 
statements with SQLite?

Thank you

Benedetta Turchi
Engineering Tools
Engineering Tools Website 




-
***
*** Symbian Software Ltd is a company registered in England and
Wales with registered number 4190020 and registered office at 2-6
Boundary Row, Southwark, London,  SE1 8HP, UK. This message is
intended only for use by the named addressee and may contain
privileged and/or confidential information. If you are not the
named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error
please notify [EMAIL PROTECTED] and delete the message and any
attachments accompanying it immediately. Neither Symbian nor any of
its Affiliates accepts liability for any corruption, interception,
amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in
compliance with Symbian corporate policy. *
*


Re: [sqlite] C++ SQLite

2006-11-28 Thread bartsmissaert
Can I call the SQLite API (as in the dll SQLite.dll) directly from
VB or do I need the wrapper? So, could it work from VB with declares
as I use for the Windows API?

RBS

> sebcity wrote:
>> How would one go about using c++ (Visual Studio.NET) to call and display
>> SQLite tables. C++ wrappers?
> You should be able to call the Sqlite3 API directly.
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>
>




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



Re: [sqlite] OT: filenaming conventions -- was: Re: [sqlite] Saving tables

2006-11-28 Thread P Kishor

On 11/28/06, Craig Morrison <[EMAIL PROTECTED]> wrote:

P Kishor wrote:
> On 11/28/06, John Stanton <[EMAIL PROTECTED]> wrote:
>> If you use an extension greater than 3 chars you violate rules for some
>> existing file systems and reduce portability.  You can also make it
>> difficult to parse the extension when it is used to type the file.
>
> we are going a bit off-thread here, but violating the file system rule
> (in this case, Windows) is precisely why I use an extension greater
> that 3 chars. For example, .db extension is used by several other
> programs -- Windows itself uses .db extension for thumbnails it
> generates for pictures inside a folder. I want to get above that
> riff-raff. The stupid system just lists my databases as "SQLITE File."
> Good enough for me.
>
> As far as portability is concerned -- my world revolves around Unixes,
> in particular Mac OS X, some Linux variants, and Windows. I have never
> had any portability issues with foo.sqlite.
>
>>
>> In medecine the Hippocratic Oath requires "First, do no harm".  Not a
>> bad principle for IT design also.
>
> I think, in good health, the first principle should be, don't expose
> yourself to ills. By making my extension illegible to anything but
> SQLite, I am not even getting in the fray.

Since we're already off-topic. :-D

I'm sure you are already aware of this, just pointing it out in context
so those that aren't have a heads up.

Just a bit of warning, as it has bitten a few in the bum, about >3
character extensions under the NT+ variants.. They can and will bite
you, for instance:

dir *.sql

Will list not only *.sql files, but *.sqlite too.

Imagine:

del *.sql

Deleting all your *.sqlite files. Whoopsie..




fair warning, but totally pointless --

'del *.s*' will delete all your sql files as well, and so will 'del
*.??l*' and and host of other variations. There are many ways of
harming oneself, but picking on arbitrarily long extensions as a
particularly dangerous one is baseless, afaik.

Recently, I read somewhere (forget the link... should be easy to
search for) -- apparently some file extensions are registered within
Windows as special files that need to be indexed on every change. One
of those extensions is '.dbd' (I could be wrong about the particular
extension... but, for the sake of argument, let's just assume it is
'.dbd'). So, every time your database changes even a little bit, the
OS wants to index it... this person who discovered this phenomenon,
claimed it was causing a performance bottleneck.

Whether or not this is true, the fact is, in Windows (and even in Mac
OS X, while using the Finder), three letter extensions mean something
special. By making it '.sqlite' (or '.bobbitybob', for that matter), I
hope to make my db immune from all this. Actually, even better might
be not having any extension at all.



--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/
---
collaborate, communicate, compete


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



Re: [sqlite] Saving tables

2006-11-28 Thread John Stanton
Sqlite is admirable in the way it uses broad standards and run on just 
about anything which can switch electrons.  It is tidy practise and 
simply good business to maintain that most desirable condition.


P Kishor wrote:

On 11/28/06, John Stanton <[EMAIL PROTECTED]> wrote:


If you use an extension greater than 3 chars you violate rules for some
existing file systems and reduce portability.  You can also make it
difficult to parse the extension when it is used to type the file.



we are going a bit off-thread here, but violating the file system rule
(in this case, Windows) is precisely why I use an extension greater
that 3 chars. For example, .db extension is used by several other
programs -- Windows itself uses .db extension for thumbnails it
generates for pictures inside a folder. I want to get above that
riff-raff. The stupid system just lists my databases as "SQLITE File."
Good enough for me.

As far as portability is concerned -- my world revolves around Unixes,
in particular Mac OS X, some Linux variants, and Windows. I have never
had any portability issues with foo.sqlite.



In medecine the Hippocratic Oath requires "First, do no harm".  Not a
bad principle for IT design also.



I think, in good health, the first principle should be, don't expose
yourself to ills. By making my extension illegible to anything but
SQLite, I am not even getting in the fray.



P Kishor wrote:
> I like using .sqlite as the extension (or .sqlite3). That way no
> Windows program will want to mess with it... usually 3 letter
> extensions are grist for the mill
>
> On 11/27/06, John Stanton <[EMAIL PROTECTED]> wrote:
>
>> Use anything you like.  Version 3 Sqlite is easy to recognize if 
you use

>> .db3.
>>
>> RB Smissaert wrote:
>> >>sqlite3 mydatabase.db3
>> >
>> >
>> > I always use the extension .db
>> > What is the difference between db3 and db or maybe db2 etc.?
>> >
>> > RBS
>> >
>> >
>> > -Original Message-
>> > From: Kees Nuyt [mailto:[EMAIL PROTECTED]
>> > Sent: 27 November 2006 22:49
>> > To: sqlite-users@sqlite.org
>> > Subject: Re: [sqlite] Saving tables
>> >
>> > On Mon, 27 Nov 2006 12:43:24 -0800 (PST), you wrote:
>> >
>> >
>> >>I typed exactly what you typed there and i get
>> >>SQL error: no such table: bar
>> >>my command window doesnt have : "sqlite3 foo.sqlite" like yours
>> >
>> >
>> > If you don't include a database name after the sqlite3 command,
>> > sqlite uses the "memory" database, which ceases to exist after
>> > you exit the program.
>> >
>> > So, use the following commamnd to create and open your database:
>> >   sqlite3 mydatabase.db3
>> >
>> > and then issue the SQL commands at the prompt to create and
>> > populate the table.
>> >
>> > Every time you want to reuse that database, you have to open it
>> > in the same way:
>> >   sqlite3 mydatabase.db3
>> >
>> > HTH
>>
>>
>> 
- 


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


>>
>>
>>
>
>


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 










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



Re[2]: [sqlite] Music Files

2006-11-28 Thread made hendra
Thanks John,
Btw, i'm not a sqlite advance nor vb.
I'm not fully understand about vb wrapper. I always using ODBC to
create database connection. Any suggest or clue? where i can find vb
wrapper for sqlite(3).



Tuesday, November 28, 2006, 11:11:04 PM, you wrote:

> I cannot help you with ODBC, but if you have an embedded sqlite database
> you may be much better off to use the Sqlite API directly rather
> than SQL/CLI (ODBC).  The Sqlite API handles BLOBs very effectively.

> Even if you use something like VB you can find an interface (wrapper) 
> for the Sqlite API which will work effectively.

> You should be aware that Sqlite is not a DBMS server like Sql Server, 
> Oracle or DB2, it is a library of routines to embed in your application.
>   If you use it that way the ODBC route does not make much sense and you
> lose much of the simplicity of Sqlite.

> An Sqlite database is just a single file, so you can see how simple that
> makes managing your application.  Backups and recovery are so simple. 
> Distribution of databases cannot be simpler.


Best Regards,
made hendra


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



Re: [sqlite] C++ SQLite

2006-11-28 Thread John Stanton
Remember the first rule of IT.  "If you don't have time do do it right, 
you don't have time to do it twice".


sebcity wrote:

Time constraints

Craig Morrison-2 wrote:


sebcity wrote:

Thanks, Could you supply an example? 


I'm not going to be as nice as everyone else, go here:

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

Do some research and then come back instead of asking for handouts.

We've all been where you are now, the difference is that we tried on our 
own and _then_ came here asking questions when we got stuck. Trying to 
do a little work on your own will do you a world of good.




Clay Dowling wrote:


sebcity wrote:


How would one go about using c++ (Visual Studio.NET) to call and
display
SQLite tables. C++ wrappers?


You could just use the API directly.  Myself, I've put a wrapper around
it, but there's nothing saying that you have to.

Clay
--
CeaMuS
http://www.ceamus.com
Simple Content Management

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








--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://pse.2cah.com
  Controlling pseudoephedrine purchases.

http://www.mtsprofessional.com/
  A Win32 email server that works for You.

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









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



Re: [sqlite] C++ SQLite

2006-11-28 Thread John Stanton

sebcity wrote:

How would one go about using c++ (Visual Studio.NET) to call and display
SQLite tables. C++ wrappers?

You should be able to call the Sqlite3 API directly.

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



[sqlite] OT: filenaming conventions -- was: Re: [sqlite] Saving tables

2006-11-28 Thread Craig Morrison

P Kishor wrote:

On 11/28/06, John Stanton <[EMAIL PROTECTED]> wrote:

If you use an extension greater than 3 chars you violate rules for some
existing file systems and reduce portability.  You can also make it
difficult to parse the extension when it is used to type the file.


we are going a bit off-thread here, but violating the file system rule
(in this case, Windows) is precisely why I use an extension greater
that 3 chars. For example, .db extension is used by several other
programs -- Windows itself uses .db extension for thumbnails it
generates for pictures inside a folder. I want to get above that
riff-raff. The stupid system just lists my databases as "SQLITE File."
Good enough for me.

As far as portability is concerned -- my world revolves around Unixes,
in particular Mac OS X, some Linux variants, and Windows. I have never
had any portability issues with foo.sqlite.



In medecine the Hippocratic Oath requires "First, do no harm".  Not a
bad principle for IT design also.


I think, in good health, the first principle should be, don't expose
yourself to ills. By making my extension illegible to anything but
SQLite, I am not even getting in the fray.


Since we're already off-topic. :-D

I'm sure you are already aware of this, just pointing it out in context 
so those that aren't have a heads up.


Just a bit of warning, as it has bitten a few in the bum, about >3 
character extensions under the NT+ variants.. They can and will bite 
you, for instance:


dir *.sql

Will list not only *.sql files, but *.sqlite too.

Imagine:

del *.sql

Deleting all your *.sqlite files. Whoopsie..

--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://pse.2cah.com
  Controlling pseudoephedrine purchases.

http://www.mtsprofessional.com/
  A Win32 email server that works for You.

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



Re: [sqlite] Music Files

2006-11-28 Thread John Stanton

made hendra wrote:

Hello John,

Tuesday, November 28, 2006, 4:08:58 AM, you wrote:



sebcity wrote:


Is it possible to store mp3 files in a SSQLite database? would they be able
to be played from the database? How would you save them?


Write them as a BLOB.




Are there Sqlite ODBC that support BLOB, or maybe other way to access
blob without ODBC?



I cannot help you with ODBC, but if you have an embedded sqlite database
you may be much better off to use the Sqlite API directly rather
than SQL/CLI (ODBC).  The Sqlite API handles BLOBs very effectively.

Even if you use something like VB you can find an interface (wrapper) 
for the Sqlite API which will work effectively.


You should be aware that Sqlite is not a DBMS server like Sql Server, 
Oracle or DB2, it is a library of routines to embed in your application. 
 If you use it that way the ODBC route does not make much sense and you 
lose much of the simplicity of Sqlite.


An Sqlite database is just a single file, so you can see how simple that 
makes managing your application.  Backups and recovery are so simple. 
Distribution of databases cannot be simpler.



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



Re: [sqlite] Music Files

2006-11-28 Thread Isaac Raway

On 11/27/06, LuYanJun <[EMAIL PROTECTED]> wrote:


Can anybody give a simple example for domestrating ?
I am puzzled by this topic, how does a music file be sotred in DB as BLOB
type?



You can insert /any/ kind of data into a SQLite database (or most any other
sort of DB for that matter). Here's a short Pascal program that would do
about what you want -- but of course getting the binary data out and into an
object that can play it is another matter. Also I imagine this would be very
slow, coming in at around 3 - 5 MB per song that has to be completely loaded
into memory from the DB before playback and begin. I have not tested this
but it gives you the idea: 1) load data into a stream / data string 2) write
as DB BLOB.

var
 MP3Source: string;
 Data: TFileStream

 DBFileName: string;
 DB: TSQLiteDatabase;
 MustCreate: boolean;
begin
 MP3Source := 'SomeSong.mp3';
 DBFileName := 'mp3.db3';

 MustCreate := not FileExists(DBFileName);
 DB := TSQLiteDatabase.Create(DBFileName);
 try
   if MustCreate then begin
 DB.ExecSQL('CREATE TABLE mp3(filename STRING PRIMARY KEY, data
BLOB);');
   end;

   Data := TFileStream.Create(MP3Source, fmOpenRead);
   try
 Data.Seek(0);

 DB.UpdateBlob('INSERT OR UPDATE INTO mp3(filename, data) ' +
   'VALUES(' + QuotedStr(MP3Source) + ', ?);', Data);
   finally
 FreeAndNil(Data);
   end;
 finally
   DB.Close;
   FreeAndNil(DB);
 end;
end;


Re: [sqlite] vb sqlite

2006-11-28 Thread John Stanton
Sqlite is very widely used as an embedded SQL database.  You probably 
use it already without knowing it. (Do you use Firefox?).


Be warned that the price you pay for its simplicity is that it is not 
suitable for enterprise DBMS applications, like running Ebay, but is 
ideal for standalone applications and very good for distributed 
applications.


I would guess that it would be a very good choice for a point of sale 
system provided that it is not required to be a central database for a 
very large number of concurrent users.  Managing a single store would be 
an ideal application, but having one Sqlite database controlling all the 
stores in Bali would not be such a good idea; that would be more 
appropriate for something like PostgreSQL.


For example we have a distributed medical supplies system with many 
local databases doing real time receipts and issues and a central global 
database.  That works very well using Sqlite and is very easy to 
administer and backup.  The local real time programs use Windows with 
the Win32 API and Sqlite3, the local interactive programs are HTML and 
JavaScript running in a WWW browser and the remote databases are Sqlite3 
embedded in a WWW server and communicating using HTTP.


made hendra wrote:

hi

I'm a newbies in sqlite, i'm a vb programmer. I want to develop
database software (Point of Sales) under vb and sqlite.

From the sqlite official website, i fond that sqlite is great
database.

I need your opinion, is it wrong or right using sqlite as database
for my vb application. Can you give me some reference where are the
right mailing list (discussing) about vb and sqlite database.

Thanks for your sharing.

made hendra
(Balinese Programmer)


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




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



Re: [sqlite] Saving tables

2006-11-28 Thread P Kishor

On 11/28/06, John Stanton <[EMAIL PROTECTED]> wrote:

If you use an extension greater than 3 chars you violate rules for some
existing file systems and reduce portability.  You can also make it
difficult to parse the extension when it is used to type the file.


we are going a bit off-thread here, but violating the file system rule
(in this case, Windows) is precisely why I use an extension greater
that 3 chars. For example, .db extension is used by several other
programs -- Windows itself uses .db extension for thumbnails it
generates for pictures inside a folder. I want to get above that
riff-raff. The stupid system just lists my databases as "SQLITE File."
Good enough for me.

As far as portability is concerned -- my world revolves around Unixes,
in particular Mac OS X, some Linux variants, and Windows. I have never
had any portability issues with foo.sqlite.



In medecine the Hippocratic Oath requires "First, do no harm".  Not a
bad principle for IT design also.


I think, in good health, the first principle should be, don't expose
yourself to ills. By making my extension illegible to anything but
SQLite, I am not even getting in the fray.



P Kishor wrote:
> I like using .sqlite as the extension (or .sqlite3). That way no
> Windows program will want to mess with it... usually 3 letter
> extensions are grist for the mill
>
> On 11/27/06, John Stanton <[EMAIL PROTECTED]> wrote:
>
>> Use anything you like.  Version 3 Sqlite is easy to recognize if you use
>> .db3.
>>
>> RB Smissaert wrote:
>> >>sqlite3 mydatabase.db3
>> >
>> >
>> > I always use the extension .db
>> > What is the difference between db3 and db or maybe db2 etc.?
>> >
>> > RBS
>> >
>> >
>> > -Original Message-
>> > From: Kees Nuyt [mailto:[EMAIL PROTECTED]
>> > Sent: 27 November 2006 22:49
>> > To: sqlite-users@sqlite.org
>> > Subject: Re: [sqlite] Saving tables
>> >
>> > On Mon, 27 Nov 2006 12:43:24 -0800 (PST), you wrote:
>> >
>> >
>> >>I typed exactly what you typed there and i get
>> >>SQL error: no such table: bar
>> >>my command window doesnt have : "sqlite3 foo.sqlite" like yours
>> >
>> >
>> > If you don't include a database name after the sqlite3 command,
>> > sqlite uses the "memory" database, which ceases to exist after
>> > you exit the program.
>> >
>> > So, use the following commamnd to create and open your database:
>> >   sqlite3 mydatabase.db3
>> >
>> > and then issue the SQL commands at the prompt to create and
>> > populate the table.
>> >
>> > Every time you want to reuse that database, you have to open it
>> > in the same way:
>> >   sqlite3 mydatabase.db3
>> >
>> > HTH
>>
>>
>> -
>>
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> -
>>
>>
>>
>
>


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





--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/
---
collaborate, communicate, compete


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



Re: [sqlite] Music Files

2006-11-28 Thread John Stanton
A BLOB is just a block of indeterminate, untyped data.  You reference it 
by a pointer and a length and recover it the same way.  Sqlite will 
store it as a linked list of pages.


Think of it as a file, which is a pointer and a length, stored by the 
file system as a group or a group of groups of linked disk sectors.


When you open a file and memory map it you get a pointer and a length 
for the file, that is compatible with a BLOB.  When you recover a BLOB 
you can write it to a file using a write API call, which has as its args 
a file descriptor to an open file, a pointer and a length.


LuYanJun wrote:

Can anybody give a simple example for domestrating ?
I am puzzled by this topic, how does a music file be sotred in DB as BLOB type?

TKS.
- Original Message - 
From: "Alex Roston" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, October 28, 2006 4:35 AM
Subject: Re: [sqlite] Music Files



At one point there was a project that did something like this, and it 
was called Route66. I think it used mysql, perl and a player called 
splay. You might google it.


Alex

sebcity wrote:



Is it possible to store mp3 files in a SSQLite database? would they be able
to be played from the database? How would you save them?





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








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



Re: [sqlite] Saving tables

2006-11-28 Thread John Stanton
If you use an extension greater than 3 chars you violate rules for some 
existing file systems and reduce portability.  You can also make it 
difficult to parse the extension when it is used to type the file.


In medecine the Hippocratic Oath requires "First, do no harm".  Not a 
bad principle for IT design also.


P Kishor wrote:

I like using .sqlite as the extension (or .sqlite3). That way no
Windows program will want to mess with it... usually 3 letter
extensions are grist for the mill

On 11/27/06, John Stanton <[EMAIL PROTECTED]> wrote:


Use anything you like.  Version 3 Sqlite is easy to recognize if you use
.db3.

RB Smissaert wrote:
>>sqlite3 mydatabase.db3
>
>
> I always use the extension .db
> What is the difference between db3 and db or maybe db2 etc.?
>
> RBS
>
>
> -Original Message-
> From: Kees Nuyt [mailto:[EMAIL PROTECTED]
> Sent: 27 November 2006 22:49
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Saving tables
>
> On Mon, 27 Nov 2006 12:43:24 -0800 (PST), you wrote:
>
>
>>I typed exactly what you typed there and i get
>>SQL error: no such table: bar
>>my command window doesnt have : "sqlite3 foo.sqlite" like yours
>
>
> If you don't include a database name after the sqlite3 command,
> sqlite uses the "memory" database, which ceases to exist after
> you exit the program.
>
> So, use the following commamnd to create and open your database:
>   sqlite3 mydatabase.db3
>
> and then issue the SQL commands at the prompt to create and
> populate the table.
>
> Every time you want to reuse that database, you have to open it
> in the same way:
>   sqlite3 mydatabase.db3
>
> HTH


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 










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



Re: [sqlite] C++ SQLite

2006-11-28 Thread Clay Dowling

sebcity said:
>
> Thanks, Could you supply an example?
>

http://www.linuxjournal.com/article/7803

Clay
-- 
Simple Content Management
http://www.ceamus.com


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



Re: [sqlite] C++ SQLite

2006-11-28 Thread Markus Hoenicka
sebcity <[EMAIL PROTECTED]> was heard to say:

>
> Time constraints
>

Good point. I've got time constraints too. Could everyone else please start to
solve all my problems right now too please?

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] A database corrupting case to report

2006-11-28 Thread drh
"Zhang Cheng-E7104C" <[EMAIL PROTECTED]> wrote:
> Hi,Richard
> The cases happens in PC. The disk remained is not much, sorts of several =
> hundreds of Mb .
> 
> Then the following step is what I do.
> 
> 1)  Create a 1M bytes size file.
> 2) create a table and begin to insert data in the table until the disk =
> comes full.
> 3)  Delete the 1M bytes file.
> 
> 4) Begin transaction
> 5) Delete records in the table, looks like "delete from tt";
> 6) End transaction(Commit).
> 

What operating system?
What type of filesystem?
What version of SQLite?
Did you compile SQLite yourself or use a version downloaded?
What makes you think the resulting database is corrupt?
Do you have a script or program for reproducing this?

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


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



Re: [sqlite] C++ SQLite

2006-11-28 Thread sebcity

Time constraints

Craig Morrison-2 wrote:
> 
> sebcity wrote:
>> Thanks, Could you supply an example? 
> 
> I'm not going to be as nice as everyone else, go here:
> 
> http://www.sqlite.org/cvstrac/wiki
> 
> Do some research and then come back instead of asking for handouts.
> 
> We've all been where you are now, the difference is that we tried on our 
> own and _then_ came here asking questions when we got stuck. Trying to 
> do a little work on your own will do you a world of good.
> 
>> 
>> Clay Dowling wrote:
>>> sebcity wrote:
 How would one go about using c++ (Visual Studio.NET) to call and
 display
 SQLite tables. C++ wrappers?
>>> You could just use the API directly.  Myself, I've put a wrapper around
>>> it, but there's nothing saying that you have to.
>>>
>>> Clay
>>> -- 
>>> CeaMuS
>>> http://www.ceamus.com
>>> Simple Content Management
>>>
>>> -
>>> To unsubscribe, send email to [EMAIL PROTECTED]
>>> -
>>>
>>>
>>>
>> 
> 
> 
> 
> -- 
> Craig Morrison
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> http://pse.2cah.com
>Controlling pseudoephedrine purchases.
> 
> http://www.mtsprofessional.com/
>A Win32 email server that works for You.
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/C%2B%2B-SQLite-tf2717819.html#a7578545
Sent from the SQLite mailing list archive at Nabble.com.


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



[sqlite] Re:[sqlite] C++ SQLite

2006-11-28 Thread Linker M Lin
u have to search sqlite++.
:)
 
--
Linker M Lin
[EMAIL PROTECTED]
※
※※我思故我在※※
※



- 原始邮件 
发件人: sebcity <[EMAIL PROTECTED]>
收件人: sqlite-users@sqlite.org
已发送: 2006/11/28(周二), 下午7:52:07
主题: Re: [sqlite] C++ SQLite


Thanks, Could you supply an example? 

Clay Dowling wrote:
> 
> sebcity wrote:
>> How would one go about using c++ (Visual Studio.NET) to call and display
>> SQLite tables. C++ wrappers?
> 
> You could just use the API directly.  Myself, I've put a wrapper around
> it, but there's nothing saying that you have to.
> 
> Clay
> -- 
> CeaMuS
> http://www.ceamus.com
> Simple Content Management
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/C%2B%2B-SQLite-tf2717819.html#a7577870
Sent from the SQLite mailing list archive at Nabble.com.


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



___ 
抢注雅虎免费邮箱-3.5G容量,20M附件! 
http://cn.mail.yahoo.com

Re: [sqlite] C++ SQLite

2006-11-28 Thread Craig Morrison

sebcity wrote:
Thanks, Could you supply an example? 


I'm not going to be as nice as everyone else, go here:

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

Do some research and then come back instead of asking for handouts.

We've all been where you are now, the difference is that we tried on our 
own and _then_ came here asking questions when we got stuck. Trying to 
do a little work on your own will do you a world of good.




Clay Dowling wrote:

sebcity wrote:

How would one go about using c++ (Visual Studio.NET) to call and display
SQLite tables. C++ wrappers?

You could just use the API directly.  Myself, I've put a wrapper around
it, but there's nothing saying that you have to.

Clay
--
CeaMuS
http://www.ceamus.com
Simple Content Management

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









--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://pse.2cah.com
  Controlling pseudoephedrine purchases.

http://www.mtsprofessional.com/
  A Win32 email server that works for You.

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



Re: [sqlite] C++ SQLite

2006-11-28 Thread Clay Dowling
sebcity wrote:
> How would one go about using c++ (Visual Studio.NET) to call and display
> SQLite tables. C++ wrappers?

You could just use the API directly.  Myself, I've put a wrapper around
it, but there's nothing saying that you have to.

Clay
-- 
CeaMuS
http://www.ceamus.com
Simple Content Management

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



[sqlite] C++ SQLite

2006-11-28 Thread sebcity

How would one go about using c++ (Visual Studio.NET) to call and display
SQLite tables. C++ wrappers?
-- 
View this message in context: 
http://www.nabble.com/C%2B%2B-SQLite-tf2717819.html#a7577607
Sent from the SQLite mailing list archive at Nabble.com.


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



Re: [sqlite] Saving tables

2006-11-28 Thread sebcity

Where do you execute the SQLite program from?
Is it just the sqlite.exe file?




John Stanton wrote:
> 
> Use anything you like.  Version 3 Sqlite is easy to recognize if you use 
> .db3.
> 
> RB Smissaert wrote:
>>>sqlite3 mydatabase.db3
>> 
>> 
>> I always use the extension .db
>> What is the difference between db3 and db or maybe db2 etc.?
>> 
>> RBS
>> 
>> 
>> -Original Message-
>> From: Kees Nuyt [mailto:[EMAIL PROTECTED] 
>> Sent: 27 November 2006 22:49
>> To: sqlite-users@sqlite.org
>> Subject: Re: [sqlite] Saving tables
>> 
>> On Mon, 27 Nov 2006 12:43:24 -0800 (PST), you wrote:
>> 
>> 
>>>I typed exactly what you typed there and i get 
>>>SQL error: no such table: bar
>>>my command window doesnt have : "sqlite3 foo.sqlite" like yours
>> 
>> 
>> If you don't include a database name after the sqlite3 command,
>> sqlite uses the "memory" database, which ceases to exist after
>> you exit the program.
>> 
>> So, use the following commamnd to create and open your database:
>>  sqlite3 mydatabase.db3
>> 
>> and then issue the SQL commands at the prompt to create and
>> populate the table.
>> 
>> Every time you want to reuse that database, you have to open it
>> in the same way:
>>  sqlite3 mydatabase.db3
>> 
>> HTH
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Saving-tables-tf2714011.html#a7577236
Sent from the SQLite mailing list archive at Nabble.com.


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



Re: [sqlite] Saving tables

2006-11-28 Thread sebcity

Where do you execute the SQLite program from?
Is it just the sqlite.exe file?




P Kishor-2 wrote:
> 
> I like using .sqlite as the extension (or .sqlite3). That way no
> Windows program will want to mess with it... usually 3 letter
> extensions are grist for the mill
> 
> On 11/27/06, John Stanton <[EMAIL PROTECTED]> wrote:
>> Use anything you like.  Version 3 Sqlite is easy to recognize if you use
>> .db3.
>>
>> RB Smissaert wrote:
>> >>sqlite3 mydatabase.db3
>> >
>> >
>> > I always use the extension .db
>> > What is the difference between db3 and db or maybe db2 etc.?
>> >
>> > RBS
>> >
>> >
>> > -Original Message-
>> > From: Kees Nuyt [mailto:[EMAIL PROTECTED]
>> > Sent: 27 November 2006 22:49
>> > To: sqlite-users@sqlite.org
>> > Subject: Re: [sqlite] Saving tables
>> >
>> > On Mon, 27 Nov 2006 12:43:24 -0800 (PST), you wrote:
>> >
>> >
>> >>I typed exactly what you typed there and i get
>> >>SQL error: no such table: bar
>> >>my command window doesnt have : "sqlite3 foo.sqlite" like yours
>> >
>> >
>> > If you don't include a database name after the sqlite3 command,
>> > sqlite uses the "memory" database, which ceases to exist after
>> > you exit the program.
>> >
>> > So, use the following commamnd to create and open your database:
>> >   sqlite3 mydatabase.db3
>> >
>> > and then issue the SQL commands at the prompt to create and
>> > populate the table.
>> >
>> > Every time you want to reuse that database, you have to open it
>> > in the same way:
>> >   sqlite3 mydatabase.db3
>> >
>> > HTH
>>
>>
>> -
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> -
>>
>>
> 
> 
> -- 
> Puneet Kishor http://punkish.eidesis.org/
> Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
> Open Source Geospatial Foundation https://edu.osgeo.org/
> ---
> collaborate, communicate, compete
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Saving-tables-tf2714011.html#a7577190
Sent from the SQLite mailing list archive at Nabble.com.


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



Re: [sqlite] Saving tables

2006-11-28 Thread sebcity

Where do you execute the SQLite program from?
Is it just the sqlite.exe file?



Kees Nuyt wrote:
> 
> On Mon, 27 Nov 2006 12:43:24 -0800 (PST), you wrote:
> 
>>
>>I typed exactly what you typed there and i get 
>>SQL error: no such table: bar
>>my command window doesnt have : "sqlite3 foo.sqlite" like yours
> 
> If you don't include a database name after the sqlite3 command,
> sqlite uses the "memory" database, which ceases to exist after
> you exit the program.
> 
> So, use the following commamnd to create and open your database:
>   sqlite3 mydatabase.db3
> 
> and then issue the SQL commands at the prompt to create and
> populate the table.
> 
> Every time you want to reuse that database, you have to open it
> in the same way:
>   sqlite3 mydatabase.db3
> 
> HTH
> -- 
>   (  Kees Nuyt
>   )
> c[_]
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Saving-tables-tf2714011.html#a7577183
Sent from the SQLite mailing list archive at Nabble.com.


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



Re: [sqlite] vb sqlite

2006-11-28 Thread Osen Kusnadi
Hi,

If you want to make an embedded database application with VB6 and
SQLite3, Please visit to http://osenxpsuite.net

And you can using Free Query Analyzer for SQLite3 database from the
following link below:
http://osenxpsuite.net/en/downloads.php?id=sqlite2006pro.exe=mail_sqlite_users

OK
made hendra wrote:
> hi
>
> I'm a newbies in sqlite, i'm a vb programmer. I want to develop
> database software (Point of Sales) under vb and sqlite.
>
> From the sqlite official website, i fond that sqlite is great
> database.
>
> I need your opinion, is it wrong or right using sqlite as database
> for my vb application. Can you give me some reference where are the
> right mailing list (discussing) about vb and sqlite database.
>
> Thanks for your sharing.
>
> made hendra
> (Balinese Programmer)
>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -

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