public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: New user questions
Date: Tue, 13 Jul 2021 15:23:11 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
On 7/13/21 3:02 PM, Rich Shepard wrote:
> 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.
To be clear triple quoting is just one of the ways you can quote things
in Python. When it is done in a specific location in a function, class
or class method then it becomes a docstring(comment). It does not turn
other things into a comment.
>> 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.
Then you want to take a look at this:
https://www.psycopg.org/docs/sql.html
For an UPDATE example see my answer to this Stack Overflow question:
https://stackoverflow.com/questions/68321746/how-to-create-a-dynamic-update-query-in-sql-using-pytho...
>
> Thanks,
>
> Rich
>
>
--
Adrian Klaver
[email protected]
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: New user questions
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox