[sqlite] sqlite3_next_stmt in SQLite 3.5.9

2008-08-22 Thread Joanne Pham
Hi Igor, I used SQLite versio n 3.5.9. I read the SQLite online document and the suggession that we need to finalize all the prepare statement associated with database connection before closing the connection as below         while( (pStmt = sqlite3_next_stmt(pDb, 0))!=0 ){          

Re: [sqlite] Any equivalent to MSSQL's UPDATE..FROM.. clause ?

2008-08-22 Thread Francis GAYREL
I met the same issue. REPLACE is the right way to override it. Assuming C1 is the primary key or at least unique, instead of UPDATE T1 INNER JOIN T2 ON T1.C1=T2.C1 SET T1.C2=T2.C2 WHERE T1.C2<>T2.C2; you can write: REPLACE INTO T1 SELECT T1.C1,T2.C2,C3,C4 FROM T1 INNER JOIN T2 ON T1.C1=T2.C1

Re: [sqlite] how to check whether the database file opend or closed?

2008-08-22 Thread Mihai Limbasan
kriscbe wrote: hi all, once the database file is opened is some other function how to check the db file is opened or not opened? is there any function like "isopen()" in sqlite??? thanks kris No, there is no such function, it's the application's responsibility to track the database

Re: [sqlite] how to check whether the database file opend or closed?

2008-08-22 Thread kriscbe
thanks for eplay mihai i am asking is there any function to check the database is opened or not opened? in a single thread? thanks kris Mihai Limbasan wrote: > > kriscbe wrote: >> hi all, >> >> once the database file is opened is some other function how to check >> the >> db file is opened

Re: [sqlite] how to check whether the database file opend or closed?

2008-08-22 Thread Mihai Limbasan
kriscbe wrote: thanks for eplay mihai i am asking is there any function to check the database is opened or not opened? in a single thread? thanks kris No, there is no such function because - you already know whether it's opened or not because you must store the database connection handle

Re: [sqlite] Multiple connection to in-memory database

2008-08-22 Thread Alex Katebi
This was the model that I was using. But I found out that I get a table lock for dropping tables for no reason when you do interleave steps for different prepares. Any body needs a proof I can create a test case for you. No I did not forget to do finalize for the prior prepares. The better

[sqlite] Recursive triggers - any news about their implementation?

2008-08-22 Thread Tomas Gold
Hello everyone! It's been almost two years since the last round of discussions about recursive trigger implementation (on this mailing list). Are there any news about their support in near future? (same with foreign keys) I wish there was a rough schedule for the unsupported features (

Re: [sqlite] Sqlite freestanding.

2008-08-22 Thread Alex Katebi
Most people are using it the way you described. I assume they had success since it is the most widely deployed data base engine. On Thu, Aug 21, 2008 at 12:07 PM, Ricardo Hawerroth Wiggers - Terceiro < [EMAIL PROTECTED]> wrote: > Hello. > > Has anyone used sqlite in a freestanding embedded

[sqlite] Details of error messages. Was: "unable to open database file" on DROP

2008-08-22 Thread D. Richard Hipp
On Aug 13, 2008, at 10:59 AM, Dennis Cote wrote: > D. Richard Hipp wrote: >> >> (2) Formal and detail requirements that define precisely what SQLite >> does. >> >> http://www.sqlite.org/draft/tokenreq.html >> http://www.sqlite.org/draft/syntax.html >> > > These look great. I noticed a

[sqlite] sqlite and åäö characters in file n ames

2008-08-22 Thread ann
Hi, I'm completely new to this list so I will now see how these mailing lists works. We have been using sqlite 3.3.7 in a small Windows MFC (C++) application. The database is placed in the Document and Settings\\Application Data\-folder. This worked fine until a user with the username

Re: [sqlite] sqlite and åäö characters in fi le names

2008-08-22 Thread Mihai Limbasan
[EMAIL PROTECTED] wrote: Hi, I'm completely new to this list so I will now see how these mailing lists works. We have been using sqlite 3.3.7 in a small Windows MFC (C++) application. The database is placed in the Document and Settings\\Application Data\-folder. This worked fine until a user

Re: [sqlite] sqlite and aao characters in file names

2008-08-22 Thread Igor Tandetnik
"Mihai Limbasan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The sqlite3_open* family of functions expects the name arguments in > UTF-8 encoding. Not quite. sqlite3_open16 et al expects UTF-16 encoding. Windows supports UTF-16 natively. Igor Tandetnik

Re: [sqlite] sqlite and aao characters in file names

2008-08-22 Thread Mihai Limbasan
Igor Tandetnik wrote: "Mihai Limbasan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] The sqlite3_open* family of functions expects the name arguments in UTF-8 encoding. Not quite. sqlite3_open16 et al expects UTF-16 encoding. Windows supports UTF-16 natively. True, I

Re: [sqlite] Detecting other connections to DB?

2008-08-22 Thread John Stanton
Open the Sqlite DB file for exclusive access. If it fails another user has it open. Alexey Pechnikov wrote: > Hello! > > В сообщении от Thursday 21 August 2008 22:45:33 Doug Porter написал(а): > >>Our software uses SQLite to save our data and we want to warn a user >>who opens a file that is

[sqlite] sqlite and åäö characters in file n ames

2008-08-22 Thread ann
Hi again, I haven't found yet where I can reply directly to posts, I guess an email should pop in when I find the correct button. Anyway ... that it was about the encoding I could have guessed and been more clear about. What I wonder is why the old sqlite3.dll from 2004-10 works and the

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Dennis Cote
Brown, Daniel wrote: > 2. And the other thing to try would be if anyone has a fairly meaty test > database they don't mind sharing that I could fling at my test > application to try and rule out the data? > Daniel, I can send you copies of the databases I am using for my testing, both the

Re: [sqlite] sqlite and åäö characters in file n ames

2008-08-22 Thread D. Richard Hipp
On Aug 22, 2008, at 10:03 AM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > What I wonder is why the old sqlite3.dll from 2004-10 works and the > newer ones don't. Older versions of SQLite contained bugs. They failed to convert UTF to the native code page before passing strings into

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Dennis Cote
Brown, Daniel wrote: > Ok so after reading your feedback I tried: > 1. "PRAGMA cache_size =10" no change in memory usage. > 2. "PRAGMA page_size = 4096" no change in memory usage. > > I'm doing both those queries (in C++) after the 'sqlite3_open( > ":memory:", _pDataBase );' in my test but before

Re: [sqlite] sqlite3_close

2008-08-22 Thread Dennis Cote
Joanne Pham wrote: > Hi Igor, > I used SQLite versio n 3.5.9. > I read the SQLite online document and the suggession that we need to finalize > all the prepare statement associated with database connection before closing > the connection as below > > while( (pStmt =

Re: [sqlite] Any equivalent to MSSQL's UPDATE..FROM.. clause ?

2008-08-22 Thread Samuel Neff
Thanks, I didn't think REPLACE would work here but you're right, it does do exactly what I need. Best regards, Sam - We're Hiring! Seeking passionate Flex, C#, or C++ (RTSP, H264) developer in the Washington D.C. Contact [EMAIL

Re: [sqlite] .import with .separator and quoted strings

2008-08-22 Thread Wilson, Ron P
Hmm. Ok I'll think about munging the data. If I find some time perhaps I'll submit some code to support quoted values in the sqlite3 command line tool. RW Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [sqlite] Details of error messages. Was: "unable to open database file" on DROP

2008-08-22 Thread Dennis Cote
D. Richard Hipp wrote: > > Consider what happens if an interaction with the library contains two > or more errors. Only a single error message and error code can be > returned. Consequently, if the interaction contains error A we cannot > guarantee that the code and message returned will

[sqlite] Performance Care

2008-08-22 Thread Bruno Moreira Guedes
Hello, I have an application which uses SQLite. The program open a sqlite database, and have about five instances running at the same time. For each instance, it waits for user commands(where the 'user' is another application), and for each command it executes some queries(about 10). Currently,

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Brown, Daniel
I just ran Dennis's test databases through the test application and we're getting similar results: 1k Pages (17.4 MB) used 18102 KB High 20416 KB 4k Pages (12.2 MB) used 18102 KB, High 26416 KB (not sure why the high is higher?) My test database however with the same test

[sqlite] sqlite and åäö characters in file n ames

2008-08-22 Thread ann
Hi, and never mind why the old work and the new one doesn't. Found myself into starting to compare sqlite code, compile and debug and I really don't have time for THAT. Curiosity can be a pain. Thanks all. /Ann ___ sqlite-users mailing list

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Dennis Cote
Brown, Daniel wrote: > I just ran Dennis's test databases through the test application and > we're getting similar results: > 1k Pages (17.4 MB) used 18102 KB High 20416 KB > 4k Pages (12.2 MB) used 18102 KB, High 26416 KB (not sure why > the high is higher?) > My test database however

[sqlite] is there a way to escape the '-' character in an FTS3 search string?

2008-08-22 Thread Jason Boehle
Is there a way to escape the negatory syntax (the minus sign / dash) in FTS3 MATCH syntax? I found that if I enclose the search term in quotes (ie. "T-Bone"), FTS3 does not treat the minus sign as a exclusion from the search. I was just wondering if there is another way that does not require me

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Wilson, Ron P
You can try using the command line tool to import csv data: sqlite> .mode csv sqlite> .import yourdata.csv yourtablename however, if you have quoted strings with commas embedded it won't work. You can try using any delimiter with .separator command. RW sqlite>select level from sqlGuruOMeter

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Jeffrey Becker
At one point I wrote some vbscript to generate a table declaration and insert statements for a csv. I might be able to dig it up if you dont mind vbscript. On Fri, Aug 22, 2008 at 1:58 PM, Brown, Daniel <[EMAIL PROTECTED]> wrote: > I just ran Dennis's test databases through the test application

Re: [sqlite] Performance Care

2008-08-22 Thread Tomas Gold
Bruno, I'm quite new to sqlite but I believe that concurrency may be an issue only for data changes which require db locking. As long as you go with SELECTs, there's not much to worry about. Tomas On Fri, Aug 22, 2008 at 7:47 PM, Bruno Moreira Guedes <[EMAIL PROTECTED]>wrote: > Hello, > > I

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Brown, Daniel
That script would be great :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Becker Sent: Friday, August 22, 2008 1:31 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Reducing SQLite Memory footprint(!) At one point I wrote

[sqlite] millisecond precision for unixepoch values

2008-08-22 Thread Myk Melez
I noticed today that JavaScript Date values (the number of milliseconds since the Unix epoch) degrade to second precision when converted to Julian date values and back using naive SQLite date/time function calls, for example: sqlite> SELECT strftime('%s', julianday(1219441430151/1000,

[sqlite] recommended declared type for Julian date columns

2008-08-22 Thread Myk Melez
Is "REAL" the recommended declared type for a column storing only Julian date values that generally include a fractional time portion? -myk ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] millisecond precision for unixepoch values

2008-08-22 Thread Igor Tandetnik
Myk Melez <[EMAIL PROTECTED]> wrote: > I noticed today that JavaScript Date values (the number of > milliseconds since the Unix epoch) degrade to second precision when > converted to Julian date values and back using naive SQLite date/time > function calls, for example: > > sqlite> SELECT

Re: [sqlite] millisecond precision for unixepoch values

2008-08-22 Thread Scott Baker
Igor Tandetnik wrote: > Myk Melez <[EMAIL PROTECTED]> wrote: >> I noticed today that JavaScript Date values (the number of >> milliseconds since the Unix epoch) degrade to second precision when >> converted to Julian date values and back using naive SQLite date/time >> function calls, for example:

Re: [sqlite] millisecond precision for unixepoch values

2008-08-22 Thread Igor Tandetnik
Scott Baker <[EMAIL PROTECTED]> wrote: > Did I do something wrong? > > SQLite version 3.5.9 > Enter ".help" for instructions > sqlite> select 1219441430151/1000, 1219441430151/1000.0; > 1219441430| Works for me. Did you perhaps compile without floating point support, or something like that? I'm

Re: [sqlite] millisecond precision for unixepoch values

2008-08-22 Thread Scott Baker
Igor Tandetnik wrote: > Scott Baker <[EMAIL PROTECTED]> wrote: >> Did I do something wrong? >> >> SQLite version 3.5.9 >> Enter ".help" for instructions >> sqlite> select 1219441430151/1000, 1219441430151/1000.0; >> 1219441430| > > Works for me. Did you perhaps compile without floating point

Re: [sqlite] millisecond precision for unixepoch values

2008-08-22 Thread Myk Melez
Igor Tandetnik wrote: > You have two problems. First, 1219441430151/1000 is done as C-style > integer truncating division, so you are losing your fractions right > there. Try > > select 1219441430151/1000, 1219441430151/1000.0; > > and see the difference. > Ah, indeed: sqlite> select

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-22 Thread Jeffrey Becker
Ok, I couldnt find the script but heres something started. On Fri, Aug 22, 2008 at 6:02 PM, Brown, Daniel <[EMAIL PROTECTED]> wrote: > That script would be great :) > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Becker > Sent: Friday,

Re: [sqlite] Multiple connection to in-memory database

2008-08-22 Thread Vincent Cridlig
tmpfs looks like the best approach for us since we then can use concurrent transactions using multiple connections from different threads and with good performances. I didn't know /tmp was mounted as a tmpfs. Thanks all for the replies. Vincent Brandon, Nicholas (UK) wrote: >> I would like