May I suggest you print out the SQL that you are building in your script for 
every statement?  I assume you can log it or display it to screen somehow? Then 
you'll see what your problem is and can try and execute those statements in the 
shell...plus you can show us.

And your error checking is not working because your statements have errors, as 
Igor pointed out, but you claims you get no errors.  Plus, you don't check the 
$err return from your statements.

Your create statement errors out but apparently your "if $SQLITE_OK <> ..." 
isn't working.  That's not SQlite's problem.

sqlite> CREATE TABLE IF NOT EXISTS todolist (entry_id INTEGER CONSTRAINT 
entry_id_c PRIMARY KEY AUTOINCREMENT, shortdesc TEXT NOT NULL DEFAULT , 
longdesc TEXT N
OT NULL DEFAULT , priority INTEGER(8) NOT NULL DEFAULT '0', state INTEGER(8) 
NOT NULL DEFAULT '0', startdt VARCHAR(25) NOT NULL DEFAULT , duedt VARCHAR(25) 
NOT
NULL DEFAULT , completeddt VARCHAR(25) NOT NULL DEFAULT;
Error: near ",": syntax error


Michael D. Black
Senior Scientist
NG Information Systems
Advanced Analytics Directorate




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Jim Michaels [j...@jimscomputerrepairandwebdesign.com]
Sent: Wednesday, September 14, 2011 6:28 PM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] UPDATE of field deletes record


with an existing record, and a fieldname that is in a column that has a
UNIQUE INDEX, if I do sqlite_exec("UPDATE database SET
fieldname="&sqlite_escape("get calculator batteries")&" WHERE
fieldname=sqlite_escape("get hp50g calc cells")&";"
this code actually deletes the record.  it should not.  I don't ever
remember seeing this happen in any database like pgsql or mysql.  I can
test again to see for sure.


the test code can be seen at
http://www.autoitscript.com/trac/autoit/ticket/2012

I used escape on the strings.  existing examples do not put single
quotes on the strings.  if single quotes are required to mske strings
work as I think they do, please tell me.  I am not getting errors.

--
Jim Michaels
j...@jimscomputerrepairandwebdesign.com
http://JimsComputerRepairandWebDesign.com
http://JesusnJim.com

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to