[sqlite] what do I compile with -dthreadsafe=1

2007-04-17 Thread Rafi Cohen
Hi, when I read the article about sqlite and multithread in cvstrac, I understood that I need to compile my source files using sqlite functions with -DTHREADSAFE=1. Now, due to a pproblem I had in my project I re-readad this article and began to think I should compile sqlite source files using

[sqlite] handling empty table in a callback function to sqlite3_exec

2007-04-15 Thread Rafi Cohen
Hi, I'm querying a table by writing the query in sqlite3_exec with a callback function that does some operation on the resulting row. Everything is fine when the table has even one row, but when it is empty, my program halts with "segmentation fault". I can add a dummy row to the table to prevent

[sqlite] FW: invoking sqlite3 command as a superuser

2007-03-22 Thread Rafi Cohen
oiding use of .import, but this way seems neat and quicker. I hope somebody will lead me towards a solution, or at least explain this strange behavior. Sorry for the lengthy message, thanks, Rafi. -Original Message----- From: Rafi Cohen [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 20, 20

[sqlite] involing sqlite3 command as a superuser

2007-03-20 Thread Rafi Cohen
Hi, for various reasons, I preffer to invoke my application as the superuser. This, in turn, invokes sqlite3 command to apply a .import command from file to table. Although .import does not return any error, the table remains empty. So, I manually entered to sqlite3 and applied the .import

[sqlite] multithread problem

2007-03-20 Thread Rafi Cohen
Hi, I probably asked about this before, but as I'm having some problems with my implementation, I would like to ask more clear questions. The main part of the application does not modify the database, but quries it occasionally (select). The other thread is responsible for the changes (import from

[sqlite] a problem trying to invoke sqlite3 commands from a C application

2007-03-19 Thread Rafi Cohen
Hi, I'm calling system from a C application in order to invoke sqlite3 database, then continue with commands: .separator "," and .import file table, all in a single string as argument to system. sqlite3 is indeed invoked with the correct database, but the problem is that the .import command is

[sqlite] 2 questions concerning select statement

2007-03-19 Thread Rafi Cohen
Hi, 1. When I prepare a select statement for later execution, may I use a question mark instead of a table and later "bind" different table names with the same cxonstruct according rto some condition? for example, sqlite3_prepare_v2(db, "select * from ? where.",...); 2. In "order by" clause

[sqlite] Format lf csv file RE: [sqlite] date/time implementation question

2007-03-14 Thread Rafi Cohen
proach. Thanks, Rafi. -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 9:15 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] date/time implementation question Rafi Cohen wrote: > Dennis, I really appreciate your patience and willingness to

RE: [sqlite] date/time implementation question

2007-03-14 Thread Rafi Cohen
/time implementation question Rafi Cohen wrote: > Thanks Denis for your detailed explanation. My needs differ from the > example you gave. I need to compare the date on each row with the > current date, if the rowdate has passed then I either insert or update > this row on a sp

[sqlite] results from a prepared select statement

2007-03-14 Thread Rafi Cohen
Hi, I read the documentation but still miss this, so basic information. I have a prepared select statement which should be executed in a later state using sqlite3_step in my application. For a very simple example, suppose the statement is: select * from tbl where col1 = ?. Now my question is how

RE: [sqlite] date/time implementation question

2007-03-14 Thread Rafi Cohen
as to make this comparison? Thanks, Rafi. -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 13, 2007 7:15 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] date/time implementation question Rafi Cohen wrote: > Hi, I hope this question is not off-topic for thi

[sqlite] date/time implementation question

2007-03-13 Thread Rafi Cohen
Hi, I hope this question is not off-topic for this list. I'm recieveing, occasionally, a .csv file from a source which I need to process accordcing to some criteria and either insert, delet or update it's rows into a database. One of it's criterias is date comparison. In other words, proceeding

RE: [sqlite] use of sqlite in a multithread C application

2007-03-02 Thread Rafi Cohen
in the same thread I intend to execute them later? Thanks, Rafi. -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Thursday, March 01, 2007 7:48 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] use of sqlite in a multithread C application Rafi Cohen wrote: > Hi

[sqlite] use of sqlite in a multithread C application

2007-03-01 Thread Rafi Cohen
Hi, I read the good article on this subject and also the api refference in the documentation and still feel that I need to ask the following question. My application has 2 threads. The main one needs to retrieve data thru select commands but does not change the database, while the other thread

[sqlite] how to insert and select a date column

2007-02-27 Thread Rafi Cohen
Hi, I apologize in advance for the probably very basic question as I'm a newbie to sqlite and integrating sql in C applications. One of my tables in my database requires a date column. I understand from a tutorial not related to C/C++ api that insering date columns is not trivial and triggers