[sqlite] SQLITE_ERROR in sqlite3_prepare

2007-05-15 Thread B V, Phanisekhar
Hello all, When I try to prepare the stmt for the query "PRAGMA cache_size = ?" I am getting an SQLITE_ERROR. Whereas it doesn't give error for queries like "select xxx from table where rowed = ?" where xxx is some combination of columns. Regards, Phanisekhar

[sqlite] Re: Can I execute queries from an sqlite3_update_hook callback function?

2007-05-15 Thread Jef Driesen
Igor Tandetnik wrote: Jef Driesen wrote: I'm trying to execute a query from the callback function that is registered with sqlite3_update_hook. But sqlite3_prepare_v2 always returns SQLITE_MISUSE. Is it not allowed to execute queries from the callback function? I'm was trying to use the

Re: [sqlite] SQLITE_ERROR in sqlite3_prepare

2007-05-15 Thread Dan Kennedy
On Tue, 2007-05-15 at 13:47 +0530, B V, Phanisekhar wrote: > Hello all, > > When I try to prepare the stmt for the query "PRAGMA > cache_size = ?" I am getting an SQLITE_ERROR. You can only use '?' in place of an SQL expression. PRAGMA commands take a literal string, identifier or

[sqlite] Order of result of a query?

2007-05-15 Thread B V, Phanisekhar
Assume the database given below mainTable (rowid INTEGER, puid INTEGER) Assume main table be Rowid Puid 1 2 2 3 3 4 4 6 5 7 6 8 "select rowid from

[sqlite] Re: Order of result of a query?

2007-05-15 Thread Igor Tandetnik
B V, Phanisekhar <[EMAIL PROTECTED]> wrote: Assume the database given below mainTable (rowid INTEGER, puid INTEGER) Assume main table be Rowid Puid 1 2 2 3 3 4 4 6 5 7 6 8

[sqlite] Re: Can I execute queries from an sqlite3_update_hook callback function?

2007-05-15 Thread Igor Tandetnik
Jef Driesen <[EMAIL PROTECTED]> wrote: Igor Tandetnik wrote: Post yourself a message from inside the hook, update UI from that message's handler. Most UI frameworks I know of have a concept of a message or event queue to which you can post user-defined events. I'm using gtk+ (actually the C++

RE: [sqlite] Re: Order of result of a query?

2007-05-15 Thread B V, Phanisekhar
>> Will the result of the above query be (1, 6, 5, 2) or (1, 2, 5, 6)? Actually I was getting the result (1, 2, 5, 6), but I wanted the result as per the given order in the OR clause "2 or 8 or 7 or 3". I wanted to know how sqlite works internally. >> Using which query we can get the result (1,

RE: [sqlite] Re: Order of result of a query?

2007-05-15 Thread Chris Peachment
Why not include another column that specifies the precise display sequence that you need and use ORDER BY on it? On Tue, 15 May 2007 19:44:44 +0530, B V, Phanisekhar wrote: >>> Will the result of the above query be (1, 6, 5, 2) or (1, 2, 5, 6)? >Actually I was getting the result (1, 2, 5, 6),

[sqlite] Re: Re: Order of result of a query?

2007-05-15 Thread Igor Tandetnik
B V, Phanisekhar <[EMAIL PROTECTED]> wrote: Assume the values in the OR clause, be replaced by some subquery. Then in such scenarios how will I be able to maintain the order? I want the order of the subquery to be preserved in the main query. Show an example. I'd like to look at the ORDER BY

Re: [sqlite] replace function?

2007-05-15 Thread Joe Wilson
No error when run with most recent SQLite. replace() may not have existed in 3.3.7. --- Jim Dodgen <[EMAIL PROTECTED]> wrote: > I get an error in version 3.3.7 when using the replace function as defined > here: > > http://sqlite.org/lang_expr.html > > "replace(X,Y,Z) Return a string

Re: [sqlite] replace function?

2007-05-15 Thread Jim Dodgen
that would make sence, thanks. Quoting Joe Wilson <[EMAIL PROTECTED]>: > No error when run with most recent SQLite. > replace() may not have existed in 3.3.7. > > --- Jim Dodgen <[EMAIL PROTECTED]> wrote: > > I get an error in version 3.3.7 when using the replace function as defined > here: > >

[sqlite] runtime errors in DEBUG with byte overflow in RC4-based random (3.3.15)

2007-05-15 Thread Andrew Finkenstadt
I am having issues with certain portions of sqlite3.c in DEBUG mode compiled under Visual Studio 8 (2005) using VC++, where the rc4-based randomizing code throws static_cast overflow errors in the byte-based array. Any objections to taking back patches that bit-wise and the result of the

Re: [sqlite] runtime errors in DEBUG with byte overflow in RC4-based random (3.3.15)

2007-05-15 Thread drh
"Andrew Finkenstadt" <[EMAIL PROTECTED]> wrote: > > Any objections to taking back patches that bit-wise and the result of the > overflowing addition with 0xff ? > The variables being added are unsigned chars and the result is stored in an unsigned char. Am I to understand that you have a

Re: [sqlite] Regexp

2007-05-15 Thread Eric Bohlman
T wrote: I know there are hooks for adding a Regexp function/operator ourselves, but I need to know it's available on other machines with standard install. It's the same reasoning, I guess, as why Trim() was added, but Regexp seems to serve a wider need. I'm pretty sure the problem is that

Re: [sqlite] runtime errors in DEBUG with byte overflow in RC4-based random (3.3.15)

2007-05-15 Thread Andrew Finkenstadt
On 5/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Andrew Finkenstadt" <[EMAIL PROTECTED]> wrote: > > Any objections to taking back patches that bit-wise and the result of the > overflowing addition with 0xff ? > The variables being added are unsigned chars and the result is stored in

RE: [sqlite] runtime errors in DEBUG with byte overflow in RC4-based random (3.3.15)

2007-05-15 Thread James Dennett
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 15, 2007 3:35 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] runtime errors in DEBUG with byte overflow in RC4- > based random (3.3.15) > > "Andrew Finkenstadt" <[EMAIL PROTECTED]>

Re: [sqlite] runtime errors in DEBUG with byte overflow in RC4-based random (3.3.15)

2007-05-15 Thread Andrew Finkenstadt
On 5/15/07, James Dennett <[EMAIL PROTECTED]> wrote: > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 15, 2007 3:35 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] runtime errors in DEBUG with byte overflow in RC4- > based random

[sqlite] sqlite3_column_xxx question

2007-05-15 Thread Mike Johnston
While using sqlite3_step(), is there a clean easy way to retrieve the data by column name instead of by ordinal? I know I can convert an ordinal to a column name but not the other way around. TIA, Mike - Take the Internet to Go: Yahoo!Go puts the

[sqlite] Re: sqlite3_column_xxx question

2007-05-15 Thread Igor Tandetnik
Mike Johnston wrote: While using sqlite3_step(), is there a clean easy way to retrieve the data by column name instead of by ordinal? I know I can convert an ordinal to a column name but not the other way around. You can enumerate all columns, retrieve the name of each, and find the one you

Re: [sqlite] Re: sqlite3_column_xxx question

2007-05-15 Thread Mike Johnston
Absolutely but it seems like duplicate effort if sqlite already has the info. Any guess if this is a big deal to put into the source? Igor Tandetnik <[EMAIL PROTECTED]> wrote: Mike Johnston wrote: > While using sqlite3_step(), is there a clean easy way to retrieve the > data by column name

[sqlite] Building a newer SQlite3 dylib/framework for XCode ?

2007-05-15 Thread Mark Gilbert
Hi Folks I am using SQLite3 in a Mac XCode project (all C, not cocoa). It's working wonderfully well. However - I find that I need one or 2 functions which are not included with the built in SQlite3 library which comes with the Mac OSX. In particular I want to add columns to existing

Re: [sqlite] Re: sqlite3_column_xxx question

2007-05-15 Thread Dan Kennedy
On Tue, 2007-05-15 at 17:24 -0700, Mike Johnston wrote: > Absolutely but it seems like duplicate effort if sqlite already has the info. > Any guess if this is a big deal to put into the source? Not a big deal at all. But there's no real advantage to putting this in the core. And it would add a