Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3QUM-0000Fc-QM for psycopg@arkaria.postgresql.org; Tue, 13 Jul 2021 22:02:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3QUK-0001FJ-LQ for psycopg@arkaria.postgresql.org; Tue, 13 Jul 2021 22:02:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3QUK-0001FB-Fv for psycopg@lists.postgresql.org; Tue, 13 Jul 2021 22:02:48 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3QUI-0002kb-86 for psycopg@postgresql.org; Tue, 13 Jul 2021 22:02:47 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 7ADA92A0106 for ; Tue, 13 Jul 2021 15:02:43 -0700 (PDT) Date: Tue, 13 Jul 2021 15:02:43 -0700 (PDT) From: Rich Shepard To: psycopg@postgresql.org Subject: Re: New user questions In-Reply-To: <36d964b4-e04b-5fdf-9b21-d3bf80a3505d@aklaver.com> Message-ID: References: <36d964b4-e04b-5fdf-9b21-d3bf80a3505d@aklaver.com> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 13 Jul 2021, Adrian Klaver wrote: > Triple quoting is used when the statement extends across more then one > line. Pair of double quotes is used for single line statement, especially > when there are single quoted values in the statement. Adrian, That makes sense: the statements are treated as comments. I hadn't thought of them that way. >> 2) How do I write a cursor execute UPDATE statement where the columns and >> values to be updated can be single or multiple and the values passed into >> the method from the tkinter widgets? Are there examples from which I can >> learn? > > There are several ways to read the above. > Send some examples of what you want to do. Here's a template: update contacts set where ; The contacts table has these attributes: person_nbr | integer act_date | date act_type | character varying(12) notes | text next_contact | date Could be a changed next_contact date, or notes, or both. Other tables need updating; for example, a new job title for a person or a new web site for a company. Thanks, Rich