[sqlite] sqlite3_value LOST

2007-08-14 Thread Mina R Waheeb
Hi, I'm trying to pass object pointer from aggregate function to the result set. The function set the result in this way: Mem *pBest; pBest = sqliteMalloc(sizeof(*pBest)); if( !pBest ) return; pBest->i = toref(value); // i set //pBest->r = 0; //pBest->z = 0; pBest->flags = MEM_Static;

Re: [sqlite] PRAGMA writable_schema=ON;

2007-08-14 Thread Joe Wilson
--- T <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > It appears that you can set > > > > PRAGMA writable_schema=ON; > > > > Then do a manual UPDATE of the sqlite_master table to insert > > > I tried it and it seems to work. But it is dangerous. If you mess > > up, you corrupt

[sqlite] PRAGMA writable_schema=ON;

2007-08-14 Thread T
[EMAIL PROTECTED] wrote: It appears that you can set PRAGMA writable_schema=ON; Then do a manual UPDATE of the sqlite_master table to insert I tried it and it seems to work. But it is dangerous. If you mess up, you corrupt the database file. Now that is interesting. I didn't realize

RE: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread Samuel R. Neff
+1 for fts3 or fts2_1 :-) --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: Scott Hess

Re: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread drh
"Scott Hess" <[EMAIL PROTECTED]> wrote: > > > > It appears that you can set > > > >PRAGMA writable_schema=ON; > > > > Then do a manual UPDATE of the sqlite_master table to insert > > an "id INTEGER PRIMARY KEY" into the SQL for the table definition. > > I tried it and it seems to work. But it

Re: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread Scott Hess
On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > "Scott Hess" <[EMAIL PROTECTED]> wrote: > > I was getting ready to checkin the rowid-versus-fts2 fix, and wanted > > to add one last bit, to upgrade older tables. > > > > Unfortunately, code of the form: > > > >ALTER TABLE x_segments

Re: [sqlite] Re: very slow inserts

2007-08-14 Thread Dennis Cote
Günter Greschenz wrote: hi, thanks for the quick answer :-) i always thought there is always an index for "rowid" ? thats the reason why i implemented it like this... i need to store a maximum amount of data in the database (e.b. max 10 entries or max 10 days) any idea how i could

[sqlite] SQLITE_BUSY error in multi-threaded environment

2007-08-14 Thread Mark Brown
Hi- I've got an application that has many different SQLite databases. Each database connection is opened in its own thread. Each database has only one connection. I created some test cases that create a database and schema on the fly and perform various SELECT, INSERTS, UPDATES on it. The

Re: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > "Scott Hess" <[EMAIL PROTECTED]> wrote: > > I was getting ready to checkin the rowid-versus-fts2 fix, and wanted > > to add one last bit, to upgrade older tables. > > > > Unfortunately, code of the form: > > > >ALTER TABLE x_segments ADD id INTEGER PRIMARY KEY;

RE: [sqlite] [Visual Basic] How do you work with SQLite?

2007-08-14 Thread Gilles Ganault
At 23:25 09/08/2007 +0100, RB Smissaert wrote: One, via an ADO recordset after connecting to Interbase with ODBC. [...] Two, via a custom Delphi dll that moves data directly from Interbase to SQLite. This is maybe slightly faster than the first method, but not that much difference. So, no ODBC

Re: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread Joe Wilson
--- Scott Hess <[EMAIL PROTECTED]> wrote: > This may mean that I'll need to branch fts2 to fts3 and deprecate > fts1/2 as being not safe for use. If the code is going to have to > create new tables and populate them, then there's not a lot of gain > versus just having the developer do that. Is

RE: [sqlite] Need To Export A Table From a SQLite Database as a TAB Character Delimited Text File

2007-08-14 Thread Rich Shepard
On Tue, 14 Aug 2007, Lee Crain wrote: I tried both of your suggestions. Both worked correctly. Yea, team! Glad you learned something useful, Lee. Rich -- Richard B. Shepard, Ph.D. |The Environmental Permitting Applied Ecosystem Services, Inc.|

RE: [sqlite] Need To Export A Table From a SQLite Database as a TAB Character Delimited Text File

2007-08-14 Thread Lee Crain
Rich, I tried both of your suggestions. Both worked correctly. Thanks for the extra information, Lee Crain __ -Original Message- From: Rich Shepard [mailto:[EMAIL PROTECTED] Sent: Monday, August 13, 2007 5:29 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite]

Re: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread drh
"Scott Hess" <[EMAIL PROTECTED]> wrote: > I was getting ready to checkin the rowid-versus-fts2 fix, and wanted > to add one last bit, to upgrade older tables. > > Unfortunately, code of the form: > >ALTER TABLE x_segments ADD id INTEGER PRIMARY KEY; > > is documented as not supported. >

[sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread Scott Hess
I was getting ready to checkin the rowid-versus-fts2 fix, and wanted to add one last bit, to upgrade older tables. Unfortunately, code of the form: ALTER TABLE x_segments ADD id INTEGER PRIMARY KEY; is documented as not supported. http://www.sqlite.org/lang_altertable.html . As far as I can

Re: [sqlite] Problem loading extension in Delphi (FTS2)

2007-08-14 Thread Ralf Junker
Hello Roberto, >Might be a typo, but your declaration defines the calling convention as >'stdcall' (instead of 'cdecl'), was your sqlite3.dll custom built with this >calling convention? I don't think much of sqlite would work with stdcall. DISQLite3 intentionally uses the 'register' calling

[sqlite] Re: Re: very slow inserts

2007-08-14 Thread Igor Tandetnik
Günter Greschenz <[EMAIL PROTECTED]> wrote: i always thought there is always an index for "rowid" ? There is, but an index cannot be used for a complex condition like rowid%10=x. An index can only be used for comparisons like rowid=x, rowid>x, rowid in (x, y, z). Imagine that you are

Re: [sqlite] Re: very slow inserts

2007-08-14 Thread Günter Greschenz
hi, thanks for the quick answer :-) i always thought there is always an index for "rowid" ? thats the reason why i implemented it like this... i need to store a maximum amount of data in the database (e.b. max 10 entries or max 10 days) any idea how i could implement it in another way ?

Re: [sqlite] Storing monetary values and calculations

2007-08-14 Thread Joe Wilson
--- Mikey C <[EMAIL PROTECTED]> wrote: > John Stanton wrote: > > We have > > added a DECIMAL type to Sqlite. This stores fixed point numbers in > > ASCII display format and performs accurate artithmetic and presents > > nicely from HTML. > > In which release was the DECIMAL affinity added to

[sqlite] Re: very slow inserts

2007-08-14 Thread Igor Tandetnik
Günter Greschenz <[EMAIL PROTECTED]> wrote: i've created this table and trigger (no index !): CREATE TABLE msgs (date ntext, type ntext, dir ntext, s integer, f integer, msg ntext); CREATE TRIGGER delete_log after insert on msgs begin delete from msgs where rowid%10=new.rowid%10

RE: [sqlite] Problem loading extension in Delphi (FTS2)

2007-08-14 Thread Andre du Plessis
No it is all cdecl, which is what I am seeing in the message? :) -Original Message- From: Roberto [mailto:[EMAIL PROTECTED] Sent: 13 August 2007 04:42 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Problem loading extension in Delphi (FTS2) Might be a typo, but your declaration

[sqlite] very slow inserts

2007-08-14 Thread Günter Greschenz
hi everybody, i have the following problem: i've created this table and trigger (no index !): CREATE TABLE msgs (date ntext, type ntext, dir ntext, s integer, f integer, msg ntext); CREATE TRIGGER delete_log after insert on msgs begin delete from msgs where rowid%10=new.rowid%10

Re: [sqlite] Storing monetary values and calculations

2007-08-14 Thread Mikey C
John Stanton wrote: > > We have > added a DECIMAL type to Sqlite. This stores fixed point numbers in > ASCII display format and performs accurate artithmetic and presents > nicely from HTML. > In which release was the DECIMAL affinity added to SQLite? Can you specify the precision and