Re: Inserting variable into

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Inserting variable into
Дата
Msg-id 5c55fb91-0b03-2077-fce7-38f2dcc0d402@aklaver.com
обсуждение исходный текст
Ответ на Inserting variable into  (<hagen@datasundae.com>)
Ответы RE: Inserting variable into  (<hagen@datasundae.com>)
Список psycopg
On 12/7/20 2:02 PM, hagen@datasundae.com wrote:
> Hello,
> 
> I'd like to use a variable for 'Big Company' (e.g. account) or where = statements generally in my cur.execute
statements:
> 
> cur.execute("SELECT SUM(revusd) FROM sfdc where saccount = 'Big Company' AND stage LIKE 'Commit%';")
> commitd1 = cur.fetchone()
> conn.commit()
> 
> but I don't know the proper syntax with the cur.execute statement to use a variable.

https://www.psycopg.org/docs/usage.html#passing-parameters-to-sql-queries

> 
> I imagine others do  - thanks!
> 
> Best,
> 
> Hagen
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке psycopg по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Inserting variable into
Следующее
От:
Дата:
Сообщение: RE: Inserting variable into