[sqlite] Checking for open transactions attach/detach database and Trigger behaviour with attached databases

2008-05-22 Thread MoDementia
Hi, My first submission 1 Problem and 1 question J My problem I have 2 processes that are causing problems after commits/locks 1. Copy main database to copydatabase using filesystem object How to determine when copydatabase is ready for attach? Attach copydatabase <-- need to

Re: [sqlite] Corrupted sqlite_sequence table

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 7:02 PM, Samuel Neff wrote: > I have a corrupt sqlite_sequence table. It has table names in the > "seq" > field. > > here is a trimmed version of data in sqlite_sequence: > > > -- Loading resources from C:\Documents and Settings\sam/.sqliterc > SQLite version 3.5.7 > Enter

Re: [sqlite] Sqlite 3.5.9 journal_mode vs ext3 journaling

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 6:50 PM, Bob Ebert wrote: > I wonder if anyone is in a position to compare and contrast the > journal_mode and synchronous settings with the various ext3 journal > modes? > > Up until now we've been using ext3 with data=ordered, and sqlite3 with > synchronous=normal,

Re: [sqlite] Very simple table...

2008-05-22 Thread BareFeet
Hi Scott, > I'm trying to decide whether LogDate should be in unixtime > format, or raw date format ('2008-01-01 13:12:11'). I use juliandate (real) to store the dates. See this web page for details: http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions Tom BareFeet

[sqlite] Corrupted sqlite_sequence table

2008-05-22 Thread Samuel Neff
I have a corrupt sqlite_sequence table. It has table names in the "seq" field. here is a trimmed version of data in sqlite_sequence: -- Loading resources from C:\Documents and Settings\sam/.sqliterc SQLite version 3.5.7 Enter ".help" for instructions sqlite> .width 50 50 sqlite> select * from

[sqlite] Sqlite 3.5.9 journal_mode vs ext3 journaling

2008-05-22 Thread Bob Ebert
I wonder if anyone is in a position to compare and contrast the journal_mode and synchronous settings with the various ext3 journal modes? Up until now we've been using ext3 with data=ordered, and sqlite3 with synchronous=normal, journal_mode=delete. We're on an embedded system with a very high

Re: [sqlite] Firefox 3 and the SQLite "bug"

2008-05-22 Thread Shawn Wilsher
Thanks! I've posted that information in the bug. Cheers, Shawn On Thu, May 22, 2008 at 4:09 PM, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > > On May 22, 2008, at 9:40 AM, Shawn Wilsher wrote: > >> It was mentioned in the bug that opening the file with the O_SYNC flag >> would no longer

Re: [sqlite] Firefox 3 and the SQLite "bug"

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 9:40 AM, Shawn Wilsher wrote: > It was mentioned in the bug that opening the file with the O_SYNC flag > would no longer require fsyncs. Has this been looked into before by > sqlite? > I have a prepared a version of SQLite that uses O_SYNC on the main database file and

Re: [sqlite] last_insert_rowid reproducible bug with triggers and FTS2 and 3

2008-05-22 Thread Dennis Cote
D. Richard Hipp wrote: > > I think the FTS virtual table is doing the INSERTs inside its xCommit > method, after the trigger has been exited. So the mechanism that > resets the last_insert_rowid when a trigger exits does not apply since > the trigger has already existed by the time the FTS

Re: [sqlite] SQLite allows "RowID" to be the name of a column

2008-05-22 Thread Darren Duncan
Ralf Junker wrote: > Darren Duncan wrote: > >> Ralf Junker wrote: >> >>> Can you suggest an alternative to a single reserved name to represent the >>> column which uniquely identifies a database record under any and all >>> circumstances? >> Yes, change the interface to RowID into a routine

Re: [sqlite] Bind arguments for insert and not null columns with default values

2008-05-22 Thread Dennis Cote
Eric Minbiole wrote: >> I have a table like this >> >> CREATE TABLE foo (bar TEXT NOT NULL DEFAULT 'default_value'); >> >> and I'd like to create a reusable statement to do inserts into foo, like >> this: >> >> INSERT INTO foo (bar) VALUES (?); >> >> Sometimes I have values for bar and sometimes

Re: [sqlite] last_insert_rowid reproducible bug with triggers and FTS2 and 3

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 3:10 PM, Dennis Cote wrote: > Bram de Jong wrote: >> >> I have found a bug which happens in both FTS2 and FTS3. >> >> The bug happens when a trigger updates an FTS table: the insert ID >> gets trashed: >> > I think both Richard and Scott may have misread this one a little

Re: [sqlite] last_insert_rowid reproducible bug with triggers and FTS2 and 3

2008-05-22 Thread Dennis Cote
Bram de Jong wrote: > > I have found a bug which happens in both FTS2 and FTS3. > > The bug happens when a trigger updates an FTS table: the insert ID gets > trashed: > > <<< > create table one > ( > id integer not null primary key

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-22 Thread Scott Baker
Skip Evans wrote: > Hey all, > > Okay, I'm looking all through the PDO docs on > php.net, but am unable to find the SQLite > equivalent to the MySQL function > > mysql_real_escape_string() > > in case, among other things, a text field contains > single quotes, etc. > > How is this done in

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 2:33 PM, Doug wrote: > Besides substituting ' with '' (double single-quotes) you might also > want to > consider trimming trailing spaces. I ended up inserting strings > like 'Doug' > and 'Doug ' in a unique-indexed column. SQLite let me do it and all > was > well.

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-22 Thread Doug
Besides substituting ' with '' (double single-quotes) you might also want to consider trimming trailing spaces. I ended up inserting strings like 'Doug' and 'Doug ' in a unique-indexed column. SQLite let me do it and all was well. One day I exported that data to MS SQL and it complained about

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Alexander Batyrshin
> 2. I tried this first: [ select * from map where (x=1 and y=1) or (x=1 and > y=2) or (x=1 and y=3) ] but that didn't use the index -- not on 3.5.6 anyway AFAIK "OR" will always omit indexes, this is why I am trying to use "IN" -- Alexander Batyrshin aka bash bash = Biomechanica Artificial

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Stephen Oberholtzer
On Thu, May 22, 2008 at 2:02 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > IN only works on a single column. The closest you can get to this is > something like > > SELECT map.* > FROM map join ( > select 1 x, 1 y > union all > select 1 x, 2 y > union all > select 1 x, 3 y)

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Alexander Batyrshin
> IN only works on a single column. The closest you can get to this is > something like > > SELECT map.* > FROM map join ( > select 1 x, 1 y > union all > select 1 x, 2 y > union all > select 1 x, 3 y) t > ON map.x = t.x AND map.y=t.y; Thanks. I will use more than 3 keys, so I

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Stephen Oberholtzer
On Thu, May 22, 2008 at 1:41 PM, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > Hello All, > For example we have table like this: > > CREATE TABLE map ( > name text, > x integer, > y integer > ); > CREATE INDEX map_xy ON map(x,y); > > How to query this table with "IN" keyword? > Query like

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Igor Tandetnik
Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > Hello All, > For example we have table like this: > > CREATE TABLE map ( > name text, > x integer, > y integer > ); > CREATE INDEX map_xy ON map(x,y); > > How to query this table with "IN" keyword? > Query like this, doesn't work: > > SELECT *

[sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Alexander Batyrshin
Hello All, For example we have table like this: CREATE TABLE map ( name text, x integer, y integer ); CREATE INDEX map_xy ON map(x,y); How to query this table with "IN" keyword? Query like this, doesn't work: SELECT * FROM map WHERE (x,y) IN ((1,1),(1,2),(1,3)); -- Alexander Batyrshin

[sqlite] Very simple table...

2008-05-22 Thread Scott Baker
I have a very simple table: CREATE TABLE Log ( LogDate, LogText ); Just when did the event happen, and what was it. So now I'm populating the fields and I'm trying to decide whether LogDate should be in unixtime format, or raw date format ('2008-01-01 13:12:11'). I'm assuming

Re: [sqlite] do someone know? DotGnu

2008-05-22 Thread Dennis Cote
David Alejandro Garcia Garcia wrote: > do some one know how i can conect from dotGnu to sqlite? i have mandriva > i hope some one can helpme Have you looked at any of the .Net wrappers at http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers? You may also want to look at the ODBC drivers at

Re: [sqlite] baffling performance decrease across network (specific case)

2008-05-22 Thread Dennis Cote
Serena Lien wrote: > Thanks for the response - no it hadn't occurred to me to try a different > network filesystem, as I don't really have access to non windows machines. > I'm just using windows xp machines set up on the same domain, where the > databases reside on shared folders. > > I actually

Re: [sqlite] SQLITE_ENABLE_FTS3

2008-05-22 Thread Dennis Cote
paul breen wrote: > I want to build sqlite3.dll with fts3 support. > > I found "#ifdef SQLITE_ENABLE_FTS3" by searching the code but I do not know > how to "def" SQLITE_ENABLE_FTS3. I can guess by setting it to some value > somewhere. > Please tell me how to do this and I will go back

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-22 Thread Dennis Cote
Skip Evans wrote: > Hey all, > > Okay, I'm looking all through the PDO docs on > php.net, but am unable to find the SQLite > equivalent to the MySQL function > > mysql_real_escape_string() > > in case, among other things, a text field contains > single quotes, etc. > > How is this done in

Re: [sqlite] FTS3 Question

2008-05-22 Thread Dennis Cote
Scott Hess wrote: > I think you're going to have to run some code to generate the string > to match against. The problem is that you need to take all of the > 'query' fields from 'category' and combine them into a string like > 'query1 OR query2 OR query3 OR ...'. I'm not aware of a way to do >

Re: [sqlite] Limitation of sqlite3_last_insert_rowid()

2008-05-22 Thread Dennis Cote
Joanne Pham wrote: > U12232 If a separate thread does a new insert on the same database connection > while the sqlite3_last_insert_rowid() function is running and thus changes > the last insert rowid, then the value returned by sqlite3_last_insert_rowid() > is unpredictable and might not equal

Re: [sqlite] interrupting sqlite3_prepare_v2

2008-05-22 Thread Dennis Cote
Daniel Önnerby wrote: > > Sometimes this interrupt occur in the middle of a > sqlite3_prepare_v2 and in some cases this will cause my application to > break in the SQLite code somewhere. > > Please let me know if you want me to investigate this futher. > Yes, please do so if you have the

Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-22 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > The attachment size limitation of the bug report is 100k :( I'm sorry about the late follow up, but I have been away for a while. Can you contact me off list to see about transferring the compressed database so I can use it to look into the problem? Dennis Cote

Re: [sqlite] Firefox 3 and the SQLite "bug"

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 9:40 AM, Shawn Wilsher wrote: > It was mentioned in the bug that opening the file with the O_SYNC flag > would no longer require fsyncs. Has this been looked into before by > sqlite? > I don't think this would work well. The O_SYNC flag causes each write() system call to

Re: [sqlite] Fetching records from Temp table

2008-05-22 Thread P Kishor
On 5/22/08, Farzana <[EMAIL PROTECTED]> wrote: > > Dear All, > > We have a table named Brand(data is not ordered by Branddescription) where > BrandDescription is one of the column and we tried to copy the Brand with > the same stucture with the table name Brand_temp and inserted the data >

Re: [sqlite] Firefox 3 and the SQLite "bug"

2008-05-22 Thread Shawn Wilsher
It was mentioned in the bug that opening the file with the O_SYNC flag would no longer require fsyncs. Has this been looked into before by sqlite? Cheers, Shawn ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Firefox 3 and the SQLite "bug"

2008-05-22 Thread D. Richard Hipp
On May 22, 2008, at 7:20 AM, Russell Leighton wrote: > > Digg has an article where it is said that the new Firefox "locks" up > under Linux due to SQLite: > > http://digg.com/linux_unix/ > Firefox_3_has_system_killing_performance_problem_for_Linux > > Bug here: > >

Re: [sqlite] Fetching records from Temp table

2008-05-22 Thread Igor Tandetnik
"Farzana" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > CREATE TABLE Brand_temp AS SELECT * FROM Brand WHERE 1=2 > insert into Brand_temp select * from brand order by branddescription > > Then we dropped the Brand table and renamed the temp table as brand > like as follows: > Drop

[sqlite] Firefox 3 and the SQLite "bug"

2008-05-22 Thread Russell Leighton
Digg has an article where it is said that the new Firefox "locks" up under Linux due to SQLite: http://digg.com/linux_unix/ Firefox_3_has_system_killing_performance_problem_for_Linux Bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=421482 Scanning the bug it seems to

Re: [sqlite] SQLite allows "RowID" to be the name of a column

2008-05-22 Thread Ralf Junker
Darren Duncan wrote: >Ralf Junker wrote: > >>Can you suggest an alternative to a single reserved name to represent the >>column which uniquely identifies a database record under any and all >>circumstances? > >Yes, change the interface to RowID into a routine call rather than a column >name;

[sqlite] Fetching records from Temp table

2008-05-22 Thread Farzana
Dear All, We have a table named Brand(data is not ordered by Branddescription) where BrandDescription is one of the column and we tried to copy the Brand with the same stucture with the table name Brand_temp and inserted the data ordered by BrandDescription into a temp table as follows: CREATE