Re: [sqlite] xcopy deployment using System.Data.SQLite for Windows x86, x64, and Mono/Unix?

2012-03-13 Thread Andrew Rondeau
Hmmm, part of the point of Mono is that a pure CLR .dll or .exe can work on any platform without recompilation. How can I have a System.Data.SQLite that will work on Windows x86, x64, and the various Unixes without recompiling System.Data.SQLite? PHX's older version of System.Data.SQLite does

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-13 Thread Igor Tandetnik
On 3/13/2012 10:38 PM, FengTao DING wrote: Hi all, I wrote a piece of code, that open two sqlite3 connections, use connection1 to do a SELECT query, while stepping in this query, when some condition matches, it uses connection2 to do a INSERT query; when another condition matches, it uses

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-13 Thread Nico Williams
Use one connection. Attach the other DBs to this one connection, then use INSERT OR REPLACE INTO table SELECT ...;. See the recent thread about INSERT OR REPLACE. Nico -- ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-13 Thread FengTao DING
Hi all, I wrote a piece of code, that open two sqlite3 connections, use connection1 to do a SELECT query, while stepping in this query, when some condition matches, it uses connection2 to do a INSERT query; when another condition matches, it uses connection2 to do a UPDATE query. As common

Re: [sqlite] No error message generated by sqlite_exec()

2012-03-13 Thread Richard Hipp
On Tue, Mar 13, 2012 at 7:06 PM, Rob Richardson wrote: > Thank you very much for your quick reply, Dr. Hipp, and I will fix my > code. Probably I was trying to execute a statement before opening the > database. > > But the question remains: Should sqlite_exec() always

Re: [sqlite] No error message generated by sqlite_exec()

2012-03-13 Thread Rob Richardson
Thank you very much for your quick reply, Dr. Hipp, and I will fix my code. Probably I was trying to execute a statement before opening the database. But the question remains: Should sqlite_exec() always generate an error message, or should I be prepared to handle the case in which it does

Re: [sqlite] No error message generated by sqlite_exec()

2012-03-13 Thread Richard Hipp
On Tue, Mar 13, 2012 at 6:43 PM, Rob Richardson wrote: > Hello! > > I am sending a badly formed query string to sqlite_exec(). It is giving > me error 21 (misuse of library), but it is not giving me an error message. > The value of the pointer sent as the fifth

[sqlite] No error message generated by sqlite_exec()

2012-03-13 Thread Rob Richardson
Hello! I am sending a badly formed query string to sqlite_exec(). It is giving me error 21 (misuse of library), but it is not giving me an error message. The value of the pointer sent as the fifth argument of sqlite_exec() is not changed. Is this expected behavior? Is there something I

Re: [sqlite] Increasing the number of attached databases beyond 10

2012-03-13 Thread Petite Abeille
On Mar 13, 2012, at 11:05 PM, Udi Karni wrote: > Is there a way to increase the number of attached databases beyond the > default of 10 - from the command shell - by issueing a command / pragma? Not from the shell, but check SQLITE_MAX_ATTACHED: http://sqlite.org/limits.html

[sqlite] Increasing the number of attached databases beyond 10

2012-03-13 Thread Udi Karni
Hello, Is there a way to increase the number of attached databases beyond the default of 10 - from the command shell - by issueing a command / pragma? I have 50+/- large tables (50GB - 100GB) and maintenance / transfer of them is much easier if each one is in its own SQLite DB file. I need to

Re: [sqlite] import a text to sqlite

2012-03-13 Thread Kees Nuyt
On Tue, 13 Mar 2012 02:28:38 +, YAN HONG YE wrote: >here my code,where is wrong? >char mma[250]; >strcpy(mma,"sqlite3 foods.db \" .separator ',' \" \".import dzhhkmysql.txt >dzh\""); >system(mma); dot-commands for the sqlite3 command line tool have to be on separate

Re: [sqlite] Trigger or sql to preserve order

2012-03-13 Thread Igor Tandetnik
On 3/13/2012 11:41 AM, Marco Bambini wrote: I have a table defined like: foo (id INTEGER, pid INTEGER, oid INTEGER) id is an unique identification number pid is parent_id oid is order_id and with some data like: id pid oid 74 1 1 42

[sqlite] Trigger or sql to preserve order

2012-03-13 Thread Marco Bambini
Hello, I have a table defined like: foo (id INTEGER, pid INTEGER, oid INTEGER) id is an unique identification number pid is parent_id oid is order_id and with some data like: id pid oid 74 1 1 42 1 2 28 0

Re: [sqlite] SELECT that returns the name of the fields

2012-03-13 Thread Alessio Forconi
Thank you, pragma is perfect! Alessio Forconi Il 12/03/12 22:47, Roger Binns ha scritto: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/12 14:42, Alessio Forconi wrote: I am a novice with SQLite and I wonder if there is a select that returns the names of the fields in the table?

Re: [sqlite] The number of parameters passed to user functions

2012-03-13 Thread Max Vlasov
On Tue, Mar 13, 2012 at 3:16 PM, Jean-Christophe Deschamps wrote: > Why do you register the function with -1 in the first place? > Register both 2- and 3-parms functions (if you have those two variations), > both pointing to the same function code: argc is valid and let you

Re: [sqlite] The number of parameters passed to user functions

2012-03-13 Thread Simon Davies
On 13 March 2012 10:59, Max Vlasov wrote: > Hi, > > Is there a way to know the number of parameters passed for user function > with undefined argument count (nArg = -1 in the Sqlite3_create_function > call). > > I could not find a function specific to this task and thought

Re: [sqlite] The number of parameters passed to user functions

2012-03-13 Thread Jean-Christophe Deschamps
Hi Max, Is there a way to know the number of parameters passed for user function with undefined argument count (nArg = -1 in the Sqlite3_create_function call). I could not find a function specific to this task and thought that I at least can check sqlite3_values array members for zero for my

[sqlite] The number of parameters passed to user functions

2012-03-13 Thread Max Vlasov
Hi, Is there a way to know the number of parameters passed for user function with undefined argument count (nArg = -1 in the Sqlite3_create_function call). I could not find a function specific to this task and thought that I at least can check sqlite3_values array members for zero for my