Re: Seeking PyGreSQL help - Mailing list pgsql-interfaces

From D'Arcy J.M. Cain
Subject Re: Seeking PyGreSQL help
Date
Msg-id 200308051244.15331.darcy@PyGreSQL.org
Whole thread Raw
In response to Re: Seeking PyGreSQL help  ("Alastair G. Hogge" <agh@tpg.com.au>)
List pgsql-interfaces
On Tuesday 05 August 2003 08:53, Alastair G. Hogge wrote:
> In pyhton?
> temp = "hello"
>
> >>> db.query("INSERT INTO test VALUES (temp, NULL)")
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> _pg.error: ERROR:  Attribute "temp" not found

Right.  That's the error.  You are trying to pass a Python variable name to 
the PostgreSQL backend.  Go to the Python page and look up formatting with 
the '%' operator.

-- 
D'Arcy J.M. Cain
PyGreSQL Development Group
http://www.PyGreSQL.org


pgsql-interfaces by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Seeking PyGreSQL help
Next
From: John Khouri
Date:
Subject: Disk usage problem with BLOBs using libpq