Re: Passing in parameters enclosed in double quotes - Mailing list psycopg

From Jan Urbański
Subject Re: Passing in parameters enclosed in double quotes
Date
Msg-id 4EC68CA6.4040401@wulczer.org
Whole thread Raw
In response to Re: Passing in parameters enclosed in double quotes  (Adrian Klaver <adrian.klaver@gmail.com>)
List psycopg
On 18/11/11 17:43, Adrian Klaver wrote:
> The only way I could get the substitution to work is:
> cur.execute("""select pg_get_serial_sequence(%s,%s)""",('"test 1"','id'))

This seems to be the only correct way to do it.

You want to call a function that accepts two text parameters, so you
need to use two Python strings as parameters. The first parameter is
'"test 1"' that is, a Python string containing "test 1". The second is
'id', that is a Python string containing id.

Cheers,
Jan

psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Passing in parameters enclosed in double quotes
Next
From: Federico Di Gregorio
Date:
Subject: Re: Passing in parameters enclosed in double quotes