Re: [sqlite] Alter table to add a variable named column

2006-05-23 Thread Pam Greene
The workaround would be to build the statement some other way (sqlite3_mprintf(), for example) for each individual ALTER TABLE command. At that point you may want to use sqlite3_exec() instead of sqlite3_prepare(), depending on how you'll be using the statement. You'll also have to be more carefu

Re: [sqlite] apostrophe troubles

2006-04-12 Thread Pam Greene
Two apostrophes in a row. SET name='O''Neil' You can also use double quotes, as long as you know your name value won't ever contain them: SET name="O'Neil" Escaping those further so the bash shell doesn't chew them is left as an exercise to the reader. - Pam On 4/12/06, Brian Johnson <[EMAIL

Re: [sqlite] Persistent user-defined functions

2006-04-07 Thread Pam Greene
On 4/7/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > On 4/7/06, Pam Greene <[EMAIL PROTECTED]> wrote: > > I use sqlite3_create_function() to attach C++ functions to SQLite > > triggers. For example, I create the SQL function INSERT_HANDLER(), > > bound to the

[sqlite] Persistent user-defined functions

2006-04-07 Thread Pam Greene
I use sqlite3_create_function() to attach C++ functions to SQLite triggers. For example, I create the SQL function INSERT_HANDLER(), bound to the C++ function InsertTriggerHandler(). Then I create a trigger: CREATE TRIGGER trig AFTER INSERT ON TableName FOR EACH ROW WHEN (INSERT_HANDLER(ne

Re: [sqlite] Syntax error near "NOT"

2006-04-05 Thread Pam Greene
What version are you using? The "IF NOT EXISTS" clause only exists in SQLite 3.3.0 and later. - Pam On 4/5/06, Lucky Luke <[EMAIL PROTECTED]> wrote: > > Ok, a VERY VERY strange error, which I can't solve. > > I use the SQLite.NET wrapper from www.phpguru.org to use it with C#. > > I have the foll

Re: [sqlite] how to fix problem of lock

2006-04-03 Thread Pam Greene
nado <[EMAIL PROTECTED]> wrote: > > > > i insert numbers and select numbers, so what could be the solutions, > > couse i have to do that > > > > > > On 4/3/06, Pam Greene < [EMAIL PROTECTED]> wrote: > > > > > > An INSERT can

Re: [sqlite] how to fix problem of lock

2006-04-03 Thread Pam Greene
An INSERT can change the results of your SELECT, so the database has to be locked during INSERT. Otherwise, the result of your SELECT would depend on whether the INSERT had finished yet. (The INSERT might even have only partly finished, which would mean the SELECT was looking at a database in an

Re: [sqlite] quote() and constraints

2006-03-29 Thread Pam Greene
On 3/29/06, jt <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm implementing a log procedure with triggers on my tables (following > some ideas found in http://www.sqlite.org/cvstrac/wiki?p=UndoRedo). > As I have more than one table, I'm generating the relevant SQL to do the > job. > I use the quote() fu

Re: [sqlite] Read row data into array?

2006-03-08 Thread Pam Greene
On 3/8/06, cstrader <[EMAIL PROTECTED]> wrote: > > Would someone be willing to share with me c++ code that reads the result > of a select query into an array representing the data of the j rows in a > selected column? I understand that callback() is executed once for each row > of the data. But w

[sqlite] Optimization help requested

2006-03-07 Thread Pam Greene
Hi all, I'm working on a system to add full-text indexing on top of SQLite in a semi-automated way. The general idea is that users will call an API to "register" a document table for indexing, and the system will take care of everything from there. When a row is added to a registered document ta

Re: [sqlite] sqlite reporting an unexpected version number

2006-03-07 Thread Pam Greene
On 3/7/06, Chuck Lima <[EMAIL PROTECTED]> wrote: > > Hi, > > I just compiled and installed sqlite-3.3.4 on FC4 and it seems to be > running just fine, except for a few things. > > sqlite3 -version returns 3.1.4 > > This in itself is not a problem, but I can't seem to get constraints > to work and t