Re: [sqlite] WinCE Memory Problem

2008-04-08 Thread Michael Ruck
You should only prepare the statement once before the loop. The only thing you should do in the loop itself is bind varying data and call sqlite_step. There's no need to call prepare, reset, finalize inside the loop. If chrPrintData doesn't change you can also move bind_blob in front of the loop.

Re: [sqlite] Any way to get more information than "constraint failed" when a constraint fails?

2008-04-08 Thread Samuel Neff
Roger, Thanks for the link. Still no indication of status though.. is this something that may get improved in a future update of sqlite? I updated the ticket I reported to include a link to the older existing ticket. Best regards, Sam On Tue, Apr 8, 2008 at 6:16 PM, Roger Binns <[EMAIL

[sqlite] Happy birthday Dr Hipp

2008-04-08 Thread Cesar D. Rodas
Happy birthday Dr. Hipp!, best wishes for you! The SQLite community! -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165 ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] WinCE Memory Problem

2008-04-08 Thread Yang WenYuan
I use the Sqlite in the PDA which is WinCE OS. I need to add more than 200,000 records. I used sqlite3_prepare-> sqlite3_bind_blob->sqlite3_step->sqlite3_finalize to write each record in to Database. However, I found that after each record is inserted, the PDA memory became larger and larger. In

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread Jay A. Kreibich
On Wed, Apr 09, 2008 at 12:09:00AM +0200, dark0s dark0s scratched on the wall: > No, it don't work, the output is: > > bash-3.1# gcc -lsqlite3 labsinf.c -o inf > labsinf.c: In function 'soundex': > labsinf.c:18: error: assignment of read-only location > labsinf.c:22: error: assignment of

Re: [sqlite] Help with query

2008-04-08 Thread P Kishor
On 4/8/08, Neville Franks <[EMAIL PROTECTED]> wrote: > Thanks Igor and Puneet, > These are very different solutions, or so it appears to me. > > Any idea whether the join or the sub-select would be faster? In my > example there is an index on tagid. Just as in any language, SQL also gives many

Re: [sqlite] Help with query

2008-04-08 Thread Neville Franks
Thanks Igor and Puneet, These are very different solutions, or so it appears to me. Any idea whether the join or the sub-select would be faster? In my example there is an index on tagid. Wednesday, April 9, 2008, 8:12:53 AM, you wrote: IT> Neville Franks <[EMAIL PROTECTED]> wrote: >> I have a

Re: [sqlite] Any way to get more information than "constraint failed" when a constraint fails?

2008-04-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Samuel Neff wrote: > I first reported this when I started working with SQLite. > > http://www.sqlite.org/cvstrac/tktview?tn=2258 There was an earlier ticket with more details about why this happens: http://www.sqlite.org/cvstrac/tktview?tn=1648

Re: [sqlite] Help with query

2008-04-08 Thread Igor Tandetnik
Neville Franks <[EMAIL PROTECTED]> wrote: > I have a table that holds 1 to many items. To keep it simple say it > has 2 columns: tagid and noteid. A given tagid can have many noteid's. > ex. > tagid noteid > -- -- > a 1 > a 4 > a 7 > b 7 > b 3 > c 1 >

Re: [sqlite] Help with query

2008-04-08 Thread P Kishor
On 4/8/08, Neville Franks <[EMAIL PROTECTED]> wrote: > I have a table that holds 1 to many items. To keep it simple say it > has 2 columns: tagid and noteid. A given tagid can have many noteid's. > ex. > tagid noteid > -- -- > a 1 > a 4 > a 7 > b 7 > b

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
No, it don't work, the output is: bash-3.1# gcc -lsqlite3 labsinf.c -o inf labsinf.c: In function 'soundex': labsinf.c:18: error: assignment of read-only location labsinf.c:22: error: assignment of read-only location labsinf.c:27: error: assignment of read-only location labsinf.c:31: error:

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
>Your assignment above discards the const qualifier. It also ignores the >fact that the types differ in their signedness. You should change your >str variable to be a const char pointer, and then explicitly cast away >the unsigned qualifier. > > const char *str; > > str = (const

[sqlite] Help with query

2008-04-08 Thread Neville Franks
I have a table that holds 1 to many items. To keep it simple say it has 2 columns: tagid and noteid. A given tagid can have many noteid's. ex. tagid noteid -- -- a 1 a 4 a 7 b 7 b 3 c 1 I want to perform a query: give me all noteid's that have tagid

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
I must create a extension for a exam. I don't want know how work soundex, but how make a extension "D. Richard Hipp" <[EMAIL PROTECTED]> ha scritto: On Apr 8, 2008, at 12:57 PM, dark0s dark0s wrote: > Hi all, I'd like write extension for sqlite3 creating soundex > function like below: >

Re: [sqlite] help about extension

2008-04-08 Thread Dennis Cote
dark0s dark0s wrote: > I need help. I am doing sqlite3 extension, but something don't work at > compile time. > > The output of compiler is: > bash-3.1# gcc -lsqlite3 labsinf.c -o inf > labsinf.c: In function 'soundex': > labsinf.c:16: warning: assignment discards qualifiers from pointer target

Re: [sqlite] sqllite+server?

2008-04-08 Thread P Kishor
On 4/8/08, Alexander Davis <[EMAIL PROTECTED]> wrote: > hey ppl > I really like the philosophy of SQLite, but I need a database that can be > accessed by multiple client computers at once, and that can be > programatically instantiated. Is there such a thing? Yes. It is called PostgreSQL.

[sqlite] wierd sqlite3.dll error message

2008-04-08 Thread Matt Murphy
I am not familiar with the DLL realm. Any idea what this means? sqlite3.dll: 127: The specified procedure could not be found. - Init_sqlite3 (LoadError) Thanks, Matt ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] passing parameters in sql strings

2008-04-08 Thread Kees Nuyt
On Tue, 8 Apr 2008 13:13:02 +0200 (CEST), you wrote: >How can I to pass parameters in sql string? >For example, I type: > > sql = "create table modulo(id, nome, classe, istanza);"; > >now, I'd like to insert a parametrized name for table. Like > >echo 'create table $modulo(id, nome, classe,

Re: [sqlite] Planner choosing wrong index

2008-04-08 Thread Jay A. Kreibich
On Tue, Apr 08, 2008 at 12:20:01PM -0700, Ken scratched on the wall: > sqlite> explain query plan select * from foo where a is not null; > order|from|detail > 0|0|TABLE foo > > sqlite> explain query plan select * from foo where a is null; > order|from|detail > 0|0|TABLE foo WITH INDEX idx_a > >

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread D. Richard Hipp
On Apr 8, 2008, at 12:57 PM, dark0s dark0s wrote: > Hi all, I'd like write extension for sqlite3 creating soundex > function like below: > SQLite already contains a soundex function. You just have to recompile using -DSQLITE_SOUNDEX=1 D. Richard Hipp [EMAIL PROTECTED]

[sqlite] help about extension

2008-04-08 Thread dark0s dark0s
I need help. I am doing sqlite3 extension, but something don't work at compile time. The output of compiler is: bash-3.1# gcc -lsqlite3 labsinf.c -o inf labsinf.c: In function 'soundex': labsinf.c:16: warning: assignment discards qualifiers from pointer target type The program is below, I am

Re: [sqlite] Planner choosing wrong index

2008-04-08 Thread Steve Krulewitz
Hi Ken -- > Sqlite is using the fact that You have an order by clause on both statements. > Removing the order by clears this up > > the first query sqlite is not able to use and index and must full scan the > table. It then uses the fact that an order by is used on column B. Thus it >

Re: [sqlite] how to add extensions to amalgamation

2008-04-08 Thread D. Richard Hipp
On Apr 8, 2008, at 8:22 AM, P Kishor wrote: > I want to add an extension or two to the amalgamation so I don't have > to load the extension manually. Can someone kindly explain or point me > to a clear tutorial on how to do so? Be gentle in your explanation as > I am not too C-savvy but can

Re: [sqlite] Planner choosing wrong index

2008-04-08 Thread Ken
sqlite> explain query plan select * from foo where a is not null; order|from|detail 0|0|TABLE foo sqlite> explain query plan select * from foo where a is null; order|from|detail 0|0|TABLE foo WITH INDEX idx_a Sqlite is using the fact that You have an order by clause on both statements. Removing

[sqlite] Planner choosing wrong index

2008-04-08 Thread Steve Krulewitz
Hey all -- I am having a problem with sqlite choosing the wrong index. This is with sqlite 3.5.7, but I believe this has been happening for a while as the general slowness caused in our app due to this has been around for a while. I've posted a reduced test case here: http://skrul.com/index.sh

[sqlite] SQLite3 and Rails - dll LoadError

2008-04-08 Thread Matt Murphy
I am trying to integrate SQLite3 into my Rails app. I have Windows XP. Have downloaded the SQLite3 dll, def and exe files and have placed them into my c:\ruby\bin directory which is on the path, and have placed them into my app's root directory. My database.yml file is set to the correct sqlite3

[sqlite] sqllite+server?

2008-04-08 Thread Alexander Davis
hey ppl I really like the philosophy of SQLite, but I need a database that can be accessed by multiple client computers at once, and that can be programatically instantiated. Is there such a thing? Thanks Alex ___ sqlite-users mailing list

[sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
Hi all, I'd like write extension for sqlite3 creating soundex function like below: void soundex() { ... ... } int main(int argc, char* argv[]) { int rc; sqlite3* db; rc = sqlite3_open("dbforext.db",); if (rc) { fprintf(stderr, "E' impossibile aprire il file %s\n",

Re: [sqlite] How to use function in binding parameters ?

2008-04-08 Thread Igor Tandetnik
Marten Feldtmann <[EMAIL PROTECTED]> wrote: > Igor Tandetnik wrote: >> It's not clear why you would want to, considering that >> date('1964-04-01') = '1964-04-01'. date() function produces a string >> in -MM-DD format (the same format you are starting with). > > Due to a totally

Re: [sqlite] how to add extensions to amalgamation

2008-04-08 Thread Jay A. Kreibich
On Tue, Apr 08, 2008 at 08:22:38AM -0400, P Kishor scratched on the wall: > I want to add an extension or two to the amalgamation so I don't have > to load the extension manually. Can someone kindly explain or point me > to a clear tutorial on how to do so? Depends on what you're trying to add.

Re: [sqlite] How to use function in binding parameters ?

2008-04-08 Thread Marten Feldtmann
Igor Tandetnik wrote: > It's not clear why you would want to, considering that > date('1964-04-01') = '1964-04-01'. date() function produces a string in > -MM-DD format (the same format you are starting with). Due to a totally misunderstanding of these functions ... forget my question

[sqlite] how to add extensions to amalgamation

2008-04-08 Thread P Kishor
I want to add an extension or two to the amalgamation so I don't have to load the extension manually. Can someone kindly explain or point me to a clear tutorial on how to do so? Be gentle in your explanation as I am not too C-savvy but can blunder my way around. (am reading a basic C tutorial

Re: [sqlite] How to use function in binding parameters ?

2008-04-08 Thread Igor Tandetnik
"Marten Feldtmann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm not sure how to use a function call in a prepared statement: > > insert into persons(name, birthday) values( ?,?) > > how to I bind the value of date('1964-04-01') to one of the > parameters ? It's not clear why

[sqlite] passing parameters in sql strings

2008-04-08 Thread dark0s dark0s
How can I to pass parameters in sql string? For example, I type: sql = "create table modulo(id, nome, classe, istanza);"; now, I'd like to insert a parametrized name for table. Like echo 'create table $modulo(id, nome, classe, istanza)' in shell scripting.

Re: [sqlite] How to use function in binding parameters ?

2008-04-08 Thread Martin.Engelschalk
Hello Marten, do this: insert into persons(name, birthday) values( ?, date(?)) And bind the string '1964-04-01' Martin Marten Feldtmann schrieb: > I'm not sure how to use a function call in a prepared statement: > > insert into persons(name, birthday) values( ?,?) > > how to I bind the value

[sqlite] How to use function in binding parameters ?

2008-04-08 Thread Marten Feldtmann
I'm not sure how to use a function call in a prepared statement: insert into persons(name, birthday) values( ?,?) how to I bind the value of date('1964-04-01') to one of the parameters ? I want to store not the string, but the value of the internal date-function-call into that column ? Somehow