|
|
Re: query: msg#00085
python.db.psycopg.devel
Matt Goodall wrote:
Timothy Smith wrote:
i'm migrating from pypgsql to psycopg, and psycopg has an issue with
this query string.
curpg.execute("""SELECT till_name,till_float
FROM till_config
JOIN transactions
USING (id)
WHERE for_venue = %s""",(Venue))
Are you sure this is the code you're actually running? I suspect you've
really got:
curpg.execute("""SELECT till_name,till_float
FROM till_config
JOIN transactions
USING (id)
WHERE for_venue = %s""" % (Venue))
^^^
Note the use of the Python string formatting operation rather than
passing the tuple (more on that in a below) to psycopg.
Also "(Venue)" does not create a tuple but "(Venue,)" does. Without the
extra "," the parentheses only affect the precedence which has no affect
here anyway.
Anyway, make sure you're using the following and I suspect you'll be ok:
curpg.execute("""SELECT till_name,till_float
FROM till_config
JOIN transactions
USING (id)
WHERE for_venue = %s""", (Venue,))
Cheers, Matt
the above is EXACTLY what i have. i cut and pasted it directly from my
program. i tried it adding the , and still i get the same issue.
fyi it's psycopg2 beta8 compiled on freebsd 6
|
|