Inserting variable into - Mailing list psycopg

From
Subject Inserting variable into
Date
Msg-id 0bef01d6cce4$987d8120$c9788360$@datasundae.com
Whole thread Raw
Responses Re: Inserting variable into  (Adrian Klaver <adrian.klaver@aklaver.com>)
List 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




psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Handling (None,) Query Results
Next
From: Adrian Klaver
Date:
Subject: Re: Inserting variable into