On Wed, 22 Jun 2005, Mike Hansen wrote:
> Thanks Danny. That did the trick. I think I had thought about putting
> the variables in the execute statement, but I didn't run across any
> examples. I'll need to read the DB API 2.0 docs some more.
Hi Mike,
No problem; it's actually a really common
Thanks Danny. That did the trick. I think I had thought about putting the
variables in the execute statement, but I didn't run across any examples. I'll
need to read the DB API 2.0 docs some more.
Mike
Danny Yoo wrote:
>>Thankfully, you don't have to change much to fix the formatting bug. The
> Thankfully, you don't have to change much to fix the formatting bug. The
> only thing you'll need to do is let the SQL cursor do the value formatting
> for you:
>
> ##
> sqlStatement = """INSERT INTO images (image)
> VALUES (%s);
> cur.execute(sqlStatement, (data_obj))
> ##
On Tue, 21 Jun 2005, Mike Hansen wrote:
> I'm having trouble loading an image into a Postgre database. The code is
> below as well as the traceback in the apache log. Is something up with
> my sqlStatement? Do I need to use something other than %s? How can I
> avoid that type error?
Hi Mike,
I'm having trouble loading an image into a Postgre database. The code is below
as well as the traceback in the apache log. Is something up with my
sqlStatement? Do I need to use something other than %s? How can I avoid that
type error?
Thanks,
Mike
#! /usr/bin/env python
import cgi
from pyP