Re: Passing in parameters enclosed in double quotes

Поиск
Список
Период
Сортировка
От Jan Urbański
Тема Re: Passing in parameters enclosed in double quotes
Дата
Msg-id 4EC68CA6.4040401@wulczer.org
обсуждение исходный текст
Ответ на Re: Passing in parameters enclosed in double quotes  (Adrian Klaver <adrian.klaver@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Passing in parameters enclosed in double quotes
Следующее
От: Federico Di Gregorio
Дата:
Сообщение: Re: Passing in parameters enclosed in double quotes