Re: [sqlite] Single quotes are causing misery

2005-03-16 Thread Eugene Wee
Hi, I think the reason is that sqlite_escape_string() doubles single quotes to escape them. However, you have magic_quotes_gpc set to 1 in php.ini As such, incoming variables are escaped using backslashes. A solution is to use stripslashes() on the incoming variables if get_magic_quotes_gpc()

[sqlite] Single quotes are causing misery

2005-03-16 Thread Peter Jay Salzman
I've nearly completed converting Wheatblog to sqlite. It's been quite a learning experience! I've come across a problem I haven't been able to figure out, though. Whenever I made a blog post that had a forward quote character (') in either the title or the body of the post, I'd get an error.

RE: Re[2]: [sqlite] [ANN] SQLite Analyzer 3

2005-03-16 Thread Guru Kathiresan
> On how many this feature seems to you important? If you are competing against free products you need to distinguish your product and it is natural for people to ask for stuff that is not available in the free stuff. If you fail to distinguish then people would just stick with the freebie.

[sqlite] Should Unary + Cast to a Number?

2005-03-16 Thread David Wheeler
Hi All, Given the below script (using DBD::SQLite 1.08, which uses SQLite 3.1.3), the output is just: +0 Cast: 2005-03-22T00:00:00 I'm wondering, however, if unary + shouldn't also be able to cast an expression to a number...shouldn't it? Thanks, David #!/usr/bin/perl -w use strict; use DBI;

Re[2]: [sqlite] [ANN] SQLite Analyzer 3

2005-03-16 Thread Sergey Startsev
Hello, Thursday, March 17, 2005, 7:48:09 AM, you wrote: >>From a quick look at sqlite analyzer, I would say the following : CM> 2. it has better looks than sqlite3Explorer In next SQLite Analyzer will have ER-model editor (such as ErWin, PowerBuilder). CM> 3. it cannot update tables using an

Re: [sqlite] python script example

2005-03-16 Thread cross wind
Thanks Gehard. Finally, I am seeing the pattern on how the scripts ought to be run. On Thu, 17 Mar 2005 01:59:28 +0100, Gerhard Haering <[EMAIL PROTECTED]> wrote: > On Thu, Mar 17, 2005 at 06:52:03AM +0800, cross wind wrote: > > On my other computer I tried installing > >

Re: [sqlite] python script example

2005-03-16 Thread Gerhard Haering
On Thu, Mar 17, 2005 at 06:52:03AM +0800, cross wind wrote: > On my other computer I tried installing > pysqlite-2.0.alpha2.win32-py2.3.exe and rerun my test script, it also > failed on the same error. However, when I changed the import line to: > > import pysqlite2.dbapi2 as sqlite > > The test

RE: [sqlite] [ANN] SQLite Analyzer 3

2005-03-16 Thread Cariotoglou Mike
>From a quick look at sqlite analyzer, I would say the following : 1. it is not free 2. it has better looks than sqlite3Explorer 3. it cannot update tables using an editable grid approach 4. it does not have a visual query builder 5. I am not sure it has ADO import/export capabilities

Re: [sqlite] database table is locked

2005-03-16 Thread Marcel Strittmatter
SQLITE_BUSY - another process has the whole database locked SQLITE_LOCKED - one sqlite3_step() is trying to read (or write) the same table that another sqlite3_step() is writing (or reading) using the same DB handle. It sounds as if Mr. Strittmatter is

Re: [sqlite] python script example

2005-03-16 Thread cross wind
On my other computer I tried installing pysqlite-2.0.alpha2.win32-py2.3.exe and rerun my test script, it also failed on the same error. However, when I changed the import line to: import pysqlite2.dbapi2 as sqlite The test script worked. However the following scripts in

Re: [sqlite] database table is locked

2005-03-16 Thread D. Richard Hipp
On Wed, 2005-03-16 at 22:40 +0100, Jakub Adamek wrote: > Also the error description "database TABLE is locked" is sometimes wrong > because it is the whole database which is locked. Perhaps another error > code/message should be created for "database is locked" (e.g. with open > cursors). >

Re: [sqlite] database table is locked

2005-03-16 Thread Jakub Adamek
Hello, I had a similar experience, but there was too much code to create a simple bug report. Surprisingly, the error disappeared if I first made a "SELECT FROM table" before the "INSERT INTO table" on the same table. Also the error description "database TABLE is locked" is sometimes wrong

Re: [sqlite] [ANN] SQLite Analyzer 3

2005-03-16 Thread Eugene Wee
Hi people, I'm relatively new to SQLite, and would like some comments as to the GUI tools listed in the wiki. In particular, does anyone actually use SQLite Analyzer 3 around here? If so, how does it compare to sqlite3Explorer? For reference sqlite3Explorer is the one on sqlite.org/contrib, and

RE: [sqlite] Conversion mysql -> sqlite

2005-03-16 Thread Reid Thompson
Peter Jay Salzman wrote: > Hi all, > > I know very little about mysql and sqlite - I've only played > around a little bit with databases, so I'm a newbie in this area. > > There's a blogger called Wheatblog that I've been trying to > convert from mysql to sqlite so I don't have to run a full >

[sqlite] database table is locked

2005-03-16 Thread Marcel Strittmatter
Hi all When I try to insert data into a table, sqlite3 responses with SQLITE_ERROR and the error message: "database table is locked". I searched already for unfinalized statements but couln't find any. The insert statement is not executed while a query is active... The problem exists only on

[sqlite] Where to put the files?

2005-03-16 Thread [EMAIL PROTECTED]
I understand that SQLite is good to learn something about sql. I downloaded: sqlite3-3.1.5.bin.gz ---> for SQLite tclsqlite-3.1.5.so.gz ---> for Tcl Now, in order to try and build some simple web page containing tcl, and see whether I can do some simple thing with it, where do I have to put the

Re: [sqlite] Row count after prepare

2005-03-16 Thread Marcelo Zamateo
Leif: There may be better solutions, but you don't need to scan the SQL, just put it as subquery: sqlite3_printf "Select Count(*) from (%s)", pSQL will do the work for you. Remember what i said about Group by clauses. Anyway i think a function like sqlite3_row_count(hStmt) would be fantastic.

Re: [sqlite] mysql_insert_id() - how to do multiple inserts safely

2005-03-16 Thread Jay
In my code I do an insert into one table, get the row id of the inserted record, then insert a related record in another table. Do you need to surround your code with a "BEGIN IMMEDIATE" "COMMIT" to ensure there are no other inserts into the first table between the insert and

Re: [sqlite] Conversion mysql -> sqlite

2005-03-16 Thread Jeremy Hinegardner
On Tue, Mar 15, 2005 at 03:26:26PM -0500, Peter Jay Salzman wrote: > Hi all, > > I know very little about mysql and sqlite - I've only played around a little > bit with databases, so I'm a newbie in this area. > > There's a blogger called Wheatblog that I've been trying to convert from > mysql

Re: [sqlite] Conversion mysql -> sqlite

2005-03-16 Thread Clay Dowling
Darren Duncan said: > Having NOT NULL with a PRIMARY KEY is redundant, if not an outright > error. Defining something as a primary key is implicitly defining it > to be both not null and distinct. -- Darren Duncan You'll find NOT NULL and PRIMARY KEY to be perfectly compatible, at least in

Re: [sqlite] mysql_insert_id()

2005-03-16 Thread Clay Dowling
Peter Jay Salzman said: > Do these two functions do the same thing? Are there any surprises or > differences between the two? They do close enough to the same thing that you don't need to worry about it. SQLite ROWIDs can be recycled if you didn't define an autoincrement column and your table

[sqlite] python script example

2005-03-16 Thread cross wind
### I have the following python test script: import sqlite cx = sqlite.connect('xyz.db') cu = cx.cursor() cu.execute('create table t1 (a,b,c)') cu.execute('insert into t1 values (1,2,3)') cx.commit() cu.execute("select * from t1") row = cu.fetchone() print row ### When ran, I get the ff