[sqlite] design question / discussion

2008-05-17 Thread Rich Rattanni
Hi I have a general design question. I have the following senario... In an embedded system running linux 2.6.2x I have a sqlite database constantly being updated with data acquired by the system. I cant lose data (hence why I am using sqlite in the first place). However periodically I have

Re: [sqlite] select userfunc(*)

2008-05-17 Thread Bradley Smith
Igor Tandetnik wrote: > "Bradley Smith" wrote: >> Igor Tandetnik wrote: >>> Bradley Smith wrote: Why does a user defined function receive zero arguments when used in the following expression? select userfunc(*) from t; >>> Why would you expect otherwise? The only

Re: [sqlite] Exceptions to sorting?

2008-05-17 Thread Andrés G. Aragoneses
Igor Tandetnik wrote: > "Andrés G. Aragoneses" <[EMAIL PROTECTED]> > wrote: >> Igor Tandetnik wrote: >>> "Andrés G. Aragoneses" >>> <[EMAIL PROTECTED]> wrote: Andrés G. Aragoneses wrote: > Igor Tandetnik wrote: >> "Andrés G. Aragoneses" >> <[EMAIL PROTECTED]> wrote: >>> Hello,

Re: [sqlite] sqlite3_transfer_bindings obsolete?

2008-05-17 Thread Dan
On May 18, 2008, at 12:01 AM, Shawn Wilsher wrote: > On Sat, May 17, 2008 at 10:13 AM, Dan <[EMAIL PROTECTED]> wrote: >> How are you going to 'clone' the statement objects to pass to >> the second database handle? > Our wrapper around the statement object already stores the string of > the sql

Re: [sqlite] sqlite3_transfer_bindings obsolete?

2008-05-17 Thread Shawn Wilsher
On Sat, May 17, 2008 at 10:13 AM, Dan <[EMAIL PROTECTED]> wrote: > How are you going to 'clone' the statement objects to pass to > the second database handle? Our wrapper around the statement object already stores the string of the sql statement, so that part is easy. Looks like we'll have to

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-17 Thread Jay A. Kreibich
On Sat, May 17, 2008 at 09:30:19AM -0500, Skip Evans scratched on the wall: > Okay, I'm looking all through the PDO docs on > php.net, but am unable to find the SQLite > equivalent to the MySQL function > > mysql_real_escape_string() > > in case, among other things, a text field contains >

Re: [sqlite] Exceptions to sorting?

2008-05-17 Thread Jay A. Kreibich
On Sat, May 17, 2008 at 09:30:30AM +0200, Petite Abeille scratched on the wall: > > On May 16, 2008, at 11:07 PM, Igor Tandetnik wrote: > > > Well, for any string A there exists another string B that sorts > > after A. > > How can I guarantee that, after I choose A as my "sorts after > >

[sqlite] Indexing virtual tables

2008-05-17 Thread Aladdin Lampé
Hi! Here is what I'm still trying to achieve: - I have a custom file format having "records" and file offsets. - Each record in that custom file format has the same number of fields, but the records itself are variable length, that's why I need a file offset to quickly locate a record. One

[sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-17 Thread Skip Evans
Hey all, Okay, I'm looking all through the PDO docs on php.net, but am unable to find the SQLite equivalent to the MySQL function mysql_real_escape_string() in case, among other things, a text field contains single quotes, etc. How is this done in SQLite? I'm still scouring the the

Re: [sqlite] sqlite3_transfer_bindings obsolete?

2008-05-17 Thread Dan
On May 17, 2008, at 7:59 PM, Shawn Wilsher wrote: > On Sat, May 17, 2008 at 2:39 AM, Dan <[EMAIL PROTECTED]> wrote: >>> And a fun follow-up question. Will sqlite3_transfer_bindings >>> transfer >>> bindings across connection objects if the two statements are for two >>> different connections

Re: [sqlite] select userfunc(*)

2008-05-17 Thread Igor Tandetnik
"Bradley Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Igor Tandetnik wrote: >> Bradley Smith wrote: >>> Why does a user defined function receive zero arguments when used in >>> the following expression? >>> >>> select userfunc(*) from t; >> >> Why would you expect

Re: [sqlite] sqlite3_transfer_bindings obsolete?

2008-05-17 Thread Shawn Wilsher
On Sat, May 17, 2008 at 2:39 AM, Dan <[EMAIL PROTECTED]> wrote: >> And a fun follow-up question. Will sqlite3_transfer_bindings transfer >> bindings across connection objects if the two statements are for two >> different connections to the same database? > > No. It will return SQLITE_MISUSE.

Re: [sqlite] FTS3 Question

2008-05-17 Thread Petite Abeille
On May 17, 2008, at 9:49 AM, Mike Marshall wrote: > SELECT guid FROM data WHERE text MATCH SELECT query FROM category Perhaps something along these lines: select data.guid fromdata joincategory on category.guid = data.guid where data.text match category.query Or something :) --

[sqlite] FTS3 Question

2008-05-17 Thread Mike Marshall
I have an FTS3 table created as follows CREATE VIRTUAL TABLE data USING fts3(guid, text) And a standard table created thus CREATE TABLE category (label, query) What I would like to be able to do is an SQL query of the form SELECT guid FROM data WHERE text MATCH SELECT query

Re: [sqlite] Exceptions to sorting?

2008-05-17 Thread Petite Abeille
On May 16, 2008, at 11:07 PM, Igor Tandetnik wrote: > Well, for any string A there exists another string B that sorts > after A. > How can I guarantee that, after I choose A as my "sorts after > everything" marker, somebody doesn't put B into the database? Well... not to beat a dead horse or

Re: [sqlite] sqlite3_transfer_bindings obsolete?

2008-05-17 Thread Dan
On May 17, 2008, at 2:51 AM, Shawn Wilsher wrote: > And a fun follow-up question. Will sqlite3_transfer_bindings transfer > bindings across connection objects if the two statements are for two > different connections to the same database? No. It will return SQLITE_MISUSE. Dan. > > Cheers,