On Mar 7, 2008, at Mar 7:11:26 AM, Anand Chitipothu wrote:
> On Fri, Mar 7, 2008 at 10:21 AM, Brian Blais <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am trying to insert rows into a sqlite database, and am getting the
> error: SQL logic error or missing database. This only happens with
> inserts, not selects, which are working fine.
>
> I am not sure how to debug this one. The insert command I have is:
>
> web.insert('comments',who=user._id_,
> comment=comment,
> filename=pic.filename,
> family_id=pic.family_id,
> person_id=pic.person_id,
> created=datetime.now(),
> picture=pic._id_)
>
> By default, web.py tries to get the id column after the insert. If
> there is no id column, seqname=False must be passed as argument to
> insert.
>
> web.insert('comments', seqname=False, ....)
>
>
> You can't figure that out from the error message. Here is bug for
> improving this.
>
> https://bugs.edge.launchpad.net/webpy/+bug/178465
>
>
Still getting the same error. Here's what I tried:
1) tried the permissions on the database (even with chmod a+w on
the .db file and the directory it was in)
2) tried the seqname:
web.insert('comments',seqname=False,who=user.id,
comment=comment,
filename=pic.filename,
family_id=pic.family_id,
person_id=pic.person_id,
created=datetime.now(),
picture=pic.id)
3) tried creating the database with id, instead of _id_, as the
primary key:
using sqlite3 from python2.5, and executing the following lines:
create table users (id integer primary key, name text, email text,
password text)
create table comments (id integer primary key, who integer, comment
text, filename text, family_id integer, person_id in
teger, created timestamp, picture integer)
I am still getting the same issue. Is id supposed to be
automatically created, or am I doing something wrong? Is there
another test I should try?
thanks,
Brian Blais
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---