Inserting variable into

From: <hagen(at)datasundae(dot)com>
To: <psycopg(at)lists(dot)postgresql(dot)org>, <psycopg(at)postgresql(dot)org>
Subject: Inserting variable into
Date: 2020-12-07 22:02:03
Message-ID: 0bef01d6cce4$987d8120$c9788360$@datasundae.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

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.

I imagine others do - thanks!

Best,

Hagen

Responses

Browse psycopg by date

  From Date Subject
Next Message Adrian Klaver 2020-12-07 22:03:42 Re: Inserting variable into
Previous Message Adrian Klaver 2020-12-05 16:19:32 Re: Handling (None,) Query Results