UPDATE command

From: Graeme Gemmill <graeme(at)gemmill(dot)name>
To: psycopg(at)postgresql(dot)org
Subject: UPDATE command
Date: 2017-07-21 16:24:48
Message-ID: 20b5f7fe-b065-d108-77d3-3fc64eb0c5fa@gemmill.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

I wish to issue an UPDATE command to update 4 columns of a row that has
a unique primary key vindex:

SQL = "UPDATE contact SET firstname, addnlnames, surname, rev WHERE
vindex =? (%s, %s, %s, %s);"
data = (.......)
cursor.execute(SQL, data)

How is the value of vindex specified? Is my ? to be replaced by %s where
the value of vindex is the first of the data values?

Yours in confusion,

Graeme

Responses

Browse psycopg by date

  From Date Subject
Next Message Tom Kazimiers 2017-07-21 18:49:20 Fetching data from binary cursor
Previous Message Adrian Klaver 2017-06-12 12:53:23 Re: Site search