[sqlite] Function Language

2007-04-05 Thread John Stanton
I have been looking around at handy way to implement elaborate functions in Sqlite. Implementing PL/SQL came to mind but recently it struck me that Javascript has data rules very similar to Sqlite and has the useful property that all executables are just data. Does anyone have views for or

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread John Stanton
I ended up writing my own application server and embedded language and it works about 100 times better than PHP (and I am being kind to PHP). It is a vindication of what they teach you in fundamental CS, it can be easier to just replace bloatware than to try to live with it. Ulrich Schöbel

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread Ulrich Schöbel
Thanks again for your help. I've given up to use SQLite with PHP and tried Postgres. This works. I'll probably give up entirely on this PHP crap. As you say, it's a lazy dog and with 12MB module size it's also a monster dog. Long live Tcl and, of course, SQLite! Ulrich On Thursday 05 April

Re: [sqlite] SQLite and nested transactions

2007-04-05 Thread Darren Duncan
At 4:38 PM -0700 4/5/07, Darren Duncan wrote: To get this to work would basically involve having additional journal files, with the original one being for the parent-most transaction, and with an additional one for each transaction level, or some such arrangement; the extra ones could have

Re: [sqlite] SQLite and nested transactions

2007-04-05 Thread Darren Duncan
At 3:43 PM -0700 4/5/07, <[EMAIL PROTECTED]> wrote: I have just read the omitted features section and noticed that SQLite doesn't support nested transactions. Which is *very* unfortunate indeed. It would be *so* much easier for users to get atomicity right at multiple levels if nested

[sqlite] SQLite and nested transactions

2007-04-05 Thread rhurst2
I have just read the omitted features section and noticed that SQLite doesn't support nested transactions. What effort is required to add this feature? What would be the next best DB that does support this feature? Ray

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread John Stanton
It is some time since I compiled it so my memory is hazy and I rely on my sparse notes. I compiled php-5.1.0 with those options and what was then the current version of Sqlite. I then compiled and linked it into Apache V2. It worked. The only ugly part was having to learn the PDO rules,

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread Ulrich Schöbel
Thanks, John, this is much better, although still not what I want. It now has (mysteriously) a sqlite version of 3.3.3. No idea where this is originated, maybe part of the bundle. I compiled sqlite-3.3.13, it's running fine, the lib is in /usr/local/lib, the headers are in /usr/local/include,

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread John Stanton
This is what I used - To install with SQLITE V3 configure - --without-sqlite --with-sqlite3=/usr/local --with-apxs=/usr/local/apache/bin/apxs SQLITE V3.2.7 is installed in /usr/local Ulrich Schöbel wrote: Yes, I'm using ./configure --enable-shared

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread Ulrich Schöbel
Yes, I'm using ./configure --enable-shared --with-pdo-sqlite=/usr/local/src/sqlite-3.3.13 --enable-sqlite-utf8 sqlite itself compiled fine, no problems there. Ulrich On Thursday 05 April 2007 19:45, Nathan Biggs wrote: > Are you using the PDO object in PHP? If not, PHP only supports 2.8.x. >

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread John Stanton
AS I recollect compiling and linking the current Sqlite V3 library into PHP was fairly straightforward once it was appreciated that Sqlite 3 linked into the PHP PDO common dataabse interface. If you use Sqlite 3 omit the Sqlite 2 and its interface. Ulrich Schöbel wrote: Hi all, my

AW: [sqlite] storing funky text in TEXT field

2007-04-05 Thread Michael Ruck
Actually UTF-8 is the better choice compared to UTF-16. I would start turning on UTF-8 as the character set on your web server and ensure that it is also specified as the document character set in all generated HTML pages. This gives browsers a hint about the text encoding to use to render pages.

Re: [sqlite] storing funky text in TEXT field

2007-04-05 Thread P Kishor
On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "P Kishor" <[EMAIL PROTECTED]> wrote: > > But, the line I quoted in my OP, namely "TEXT. The value is a text > string, stored using the database encoding (UTF-8, UTF-16BE or > UTF-16-LE)." is confusing me. What is this "database encoding"

Re: [sqlite] storing funky text in TEXT field

2007-04-05 Thread drh
"P Kishor" <[EMAIL PROTECTED]> wrote: > > But, the line I quoted in my OP, namely "TEXT. The value is a text > string, stored using the database encoding (UTF-8, UTF-16BE or > UTF-16-LE)." is confusing me. What is this "database encoding" and > where do I have to tackle this? > > Do I have to

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread drh
Ulrich =?iso-8859-1?q?Sch=F6bel?= <[EMAIL PROTECTED]> wrote: > Hi all, > > my apologies if this is the wrong list to ask: > > I'm trying to get php5 with sqlite3.3.13 running, but I'm completely stuck. > Whatever I tell configure, it always configures the bundled 2.8.x sqlite. > > Is there

Re: [sqlite] storing funky text in TEXT field

2007-04-05 Thread P Kishor
Thanks Clark. See my response below -- On 4/5/07, Clark Christensen <[EMAIL PROTECTED]> wrote: I hate it when the CGI transaction clobbers characters. so, I am not the only one. Phew. You can set the content-encoding in the HTML to UTF-8, and it might help, but I think the conversion from

RE: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread Nathan Biggs
Are you using the PDO object in PHP? If not, PHP only supports 2.8.x. To use 3 or greater, you must use the PDO object to connect. Also make sure that you extension is enabled for pdo_sqlite. -Original Message- From: Ulrich Schöbel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 05,

Re: [sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread Nuno Lucas
On 4/5/07, Ulrich Schöbel <[EMAIL PROTECTED]> wrote: Hi all, my apologies if this is the wrong list to ask: I'm trying to get php5 with sqlite3.3.13 running, but I'm completely stuck. Whatever I tell configure, it always configures the bundled 2.8.x sqlite. 2.8.x and 3.3.x are separate

[sqlite] PHP5 and SQLite3.3.13

2007-04-05 Thread Ulrich Schöbel
Hi all, my apologies if this is the wrong list to ask: I'm trying to get php5 with sqlite3.3.13 running, but I'm completely stuck. Whatever I tell configure, it always configures the bundled 2.8.x sqlite. Is there anybody in the know? Thanks Ulrich

Re: [sqlite] Re: storing funky text in TEXT field

2007-04-05 Thread Clark Christensen
> Suffice to say there is a terrible degree of annoying niggly details, > as ever when both “web” and “charset” show up in a single sentence. Very true :-)) If you ever find the energy to correct my errors, I'd be glad to hear it. -Clark - Original Message From: A. Pagaltzis

Re: [sqlite] Using the Sqlite Btree Backend directly

2007-04-05 Thread rhurst2
John Stanton <[EMAIL PROTECTED]> wrote: > Rollback is a problem with simpler software. > > You are basically specifying Sqlite in your requirements, and it does > all that wiith a small footprint based on the capability. > > You might contact Dr Hipp and enquire about a commercial

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Martin Jenkins
Dennis Cote wrote: P Kishor wrote: Anyway a little digging on wikipedia found this: /SQL/ is commonly spoken either as the names of the letters /ess-cue-el/ I pronounce XQP as ex queue pee so I reckon SQL should be ess queue ell, even if it was around twenty years before I was. Anyone who

[sqlite] Re: storing funky text in TEXT field

2007-04-05 Thread A. Pagaltzis
* Clark Christensen <[EMAIL PROTECTED]> [2007-04-05 17:25]: > I hate it when the CGI transaction clobbers characters. You > can set the content-encoding in the HTML to UTF-8, and it might > help, but I think the conversion from the urlencoded value is > dependent on the web server platform's

Re: [sqlite] API for backups

2007-04-05 Thread Paul Richards
I've been starting work on something similar... I'm opening the file manually, invoking the Win32 LockFileEx() function to get myself a shared "reader" lock on the entire file, then copying.. I guess it'll do, at least until SQLite chooses a different way to implement locking. On 05/04/07,

Re: [sqlite] Using the Sqlite Btree Backend directly

2007-04-05 Thread John Stanton
Rollback is a problem with simpler software. You are basically specifying Sqlite in your requirements, and it does all that wiith a small footprint based on the capability. You might contact Dr Hipp and enquire about a commercial version of Sqlite which strips out the SQL compiler and uses

[sqlite] Re: Math functions

2007-04-05 Thread Igor Tandetnik
Brad Stiles <[EMAIL PROTECTED]> wrote: On 4/4/07, Nathan Biggs <[EMAIL PROTECTED]> wrote: Does anyone know if there is a floor function in sqlite, or of a way to implement it. Well, the suggestions about extending SQLite are probably quicker, but if a SQL solution is required for

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Dennis Cote
P Kishor wrote: snobs ;-) Hardly. More like Defenders of the One True Way. ;-) ...to each her own. And there is no need for this sort of feminist activism on this list either. :-) Anyway a little digging on wikipedia found this: /SQL/ is commonly spoken either as the names of the

Re: [sqlite] storing funky text in TEXT field

2007-04-05 Thread Clark Christensen
I hate it when the CGI transaction clobbers characters. You can set the content-encoding in the HTML to UTF-8, and it might help, but I think the conversion from the urlencoded value is dependent on the web server platform's encoding (OS codepage, app platform settings, etc.) Plus, you run

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread P Kishor
On 4/5/07, Dan Baker <[EMAIL PROTECTED]> wrote: - Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: "sqlite-users" Sent: Wednesday, April 04, 2007 2:24 PM Subject: [sqlite] SQL and SQLite pronounciation? > Hi All, > > I have a simple question; how

Re: [sqlite] API for backups

2007-04-05 Thread Clark Christensen
I don't know if there are any APIs for backing-up. I don't think there are. I use this algorithm: open database using sqlite3_open() or equivalent in your wrapper. begin immediate or exclusive transaction to lock the database from all other access copy the file on the file system rollback

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Dan Baker
- Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: "sqlite-users" Sent: Wednesday, April 04, 2007 2:24 PM Subject: [sqlite] SQL and SQLite pronounciation? Hi All, I have a simple question; how do you pronounce SQL and SQLite? In the book

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Martin Jenkins
P Kishor wrote: In any case, unless DRH establishes a semi-official policy, let the pronounciation be in public domain as well... to each her own. Well there is that Google video. You could look at that to get Dr Hipp's definitive pronunciation, but ISTR even he wasn't 100% consistent. ;)

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread pompomJuice
The query that is failing is fairly simple: sprintf( strStmt, "select count(*) from sqlite_master where type = 'table' and tbl_name = '%s'", tableName); I have checked and there are no "loose" queries hanging around and furthermore this is the first query that is executed by the program; To

[sqlite] storing funky text in TEXT field

2007-04-05 Thread P Kishor
Seems like a basic question, but I can't figure out a definitive answer to this. I want to store UTF-8 characters in a TEXT field, y'know, things like umlauts and accents and that Norwegian slashed-O thingy, perhaps even South Asian Devnagari. The documentation says about text -- "TEXT. The value

Re: [sqlite] efficacy of indexing a blob

2007-04-05 Thread Dennis Cote
Andrew Finkenstadt wrote: It would appear that SQLite supports indexing every data type. What would the efficienty of the index by if I indexed a binary data column? Similarly, if I wanted to have a datatype which was the equivalent of "RAW" (non-interpreted text), it would appear I want to

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread P Kishor
On 4/5/07, Dennis Cote <[EMAIL PROTECTED]> wrote: Martin Pelletier wrote: > > Hearing "sequel" for SQL always makes me cringe. > Me too! That is what prompted my original message. I just wanted to see if I was perhaps the only one who was bothered by that pronunciation. Thanks for the

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Dennis Cote
Martin Pelletier wrote: Hearing "sequel" for SQL always makes me cringe. Me too! That is what prompted my original message. I just wanted to see if I was perhaps the only one who was bothered by that pronunciation. Thanks for the confirmation. Dennis Cote

Re: [sqlite] What query should I use?

2007-04-05 Thread Hugh Gibson
> but of course there is an EXACT answer for my question - there are > selected only the rows when Text2 changes... How to get also always > the first row from original data set? Just UNION the result with a query that gets the first row from the table. Hugh

Re: [sqlite] Math functions

2007-04-05 Thread Brad Stiles
> On 4/4/07, Nathan Biggs <[EMAIL PROTECTED]> wrote: > Does anyone know if there is a floor function in sqlite, or of a way to > implement it. > Well, the suggestions about extending SQLite are probably quicker, but if a SQL solution is required for portability, you can try something like this:

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread Dan Kennedy
On Thu, 2007-04-05 at 05:37 -0700, pompomJuice wrote: > Yes this is with the 3.3.14 code. I initially got the problem with the 3.3.12 > code so I just upgraded to the 3.3.14 code but it behaves exactly the same. > > Just to recap, my proposed fix was > //--- > while( rc == SQLITE_SCHEMA ) > rc

RE: [sqlite] Re: Math functions

2007-04-05 Thread Nathan Biggs
That was exactly what I was looking for thanks! -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 6:41 PM To: SQLite Subject: [sqlite] Re: Math functions Nathan Biggs <[EMAIL PROTECTED]> wrote: > Does anyone know if there is a floor

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread pompomJuice
Yes this is with the 3.3.14 code. I initially got the problem with the 3.3.12 code so I just upgraded to the 3.3.14 code but it behaves exactly the same. Just to recap, my proposed fix was //--- while( rc == SQLITE_SCHEMA ) rc = prepare_v2; // Some generic rc error checking here for

Re: [sqlite] Default sqlite memory management policy

2007-04-05 Thread Rich Rattanni
On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Rich Rattanni" <[EMAIL PROTECTED]> wrote: > > I am just wondering should I take matters into my own hands, > and compile and make use of sqlite3_soft_heap_limit(), or can I trust > SQLITE to manage it for me. If you do not set

[sqlite] Re: What query should I use?

2007-04-05 Thread Igor Tandetnik
woj <[EMAIL PROTECTED]> wrote: Thanks for your reply, the query you have suggested works fine, but there is missing the first row, so the result look: IdText1 Text2 Text3 Text4 --- 31003 12 test04 test12 61005 11 test17

Re: [sqlite] Default sqlite memory management policy

2007-04-05 Thread drh
"Rich Rattanni" <[EMAIL PROTECTED]> wrote: > > I am just wondering should I take matters into my own hands, > and compile and make use of sqlite3_soft_heap_limit(), or can I trust > SQLITE to manage it for me. If you do not set sqlite3_soft_heap_limit(), SQLite assumes you are on a workstation

Re: [sqlite] Default sqlite memory management policy

2007-04-05 Thread Rich Rattanni
On 4/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Rich Rattanni" <[EMAIL PROTECTED]> wrote: > On 4/3/07, Rich Rattanni <[EMAIL PROTECTED]> wrote: > > All: > >I was wondering exactly how SQLite handles freeing memory used > > from the heap when compiled without

[sqlite] API for backups

2007-04-05 Thread Paul Richards
Hi, Are there functions in the SQLite API for creating live backups of a database? I see that the sqlite3 command line tool has a "dump" command, but can this feature be accessed through the normal C API? -- Paul Richards

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread Dan Kennedy
On Thu, 2007-04-05 at 04:04 -0700, pompomJuice wrote: > Ok. > > I went and re-prepared the statement anyway even though the documentation > says it won't work. This trick only works if you finalize the failed > statement after the step command. Otherwhise you keep on getting > SQLITE_SCHEMA

Re: [sqlite] What query should I use?

2007-04-05 Thread woj
Hi Igor, Thanks for your reply, the query you have suggested works fine, but there is missing the first row, so the result look: IdText1 Text2 Text3 Text4 --- 31003 12 test04 test12 61005 11 test17 test67 71005

[sqlite] efficacy of indexing a blob

2007-04-05 Thread Andrew Finkenstadt
It would appear that SQLite supports indexing every data type. What would the efficienty of the index by if I indexed a binary data column? Similarly, if I wanted to have a datatype which was the equivalent of "RAW" (non-interpreted text), it would appear I want to create a database using UTF-8

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread pompomJuice
Ok. I went and re-prepared the statement anyway even though the documentation says it won't work. This trick only works if you finalize the failed statement after the step command. Otherwhise you keep on getting SQLITE_SCHEMA errors which might cause and endless loop if so implemented.

[sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread pompomJuice
Hello. I recently rewrote most of my SQLite wrappers to now ignore SCHEMA errors, as these are now automagically handled by the new sqlite3_prepare_v2 API. The logic changes were simple so I did not bother to test it and continued with development. Now that development is complete and testing