Re: New user questions

2021-07-14 Thread Rich Shepard
On Tue, 13 Jul 2021, Adrian Klaver wrote: Then you want to take a look at this: https://www.psycopg.org/docs/sql.html Adrian, Based on pages 1-2 of that doc I've re-written one each of an insert and select query. When they are correct I'll do the rest of the insert and select queries. Query

Re: New user questions

2021-07-14 Thread Adrian Klaver
On 7/14/21 10:35 AM, Rich Shepard wrote: On Tue, 13 Jul 2021, Adrian Klaver wrote: Then you want to take a look at this: https://www.psycopg.org/docs/sql.html Adrian, Based on pages 1-2 of that doc I've re-written one each of an insert and select query. When they are correct I'll do the rest

Re: New user questions

2021-07-14 Thread Adrian Klaver
On 7/14/21 10:57 AM, Adrian Klaver wrote: On 7/14/21 10:35 AM, Rich Shepard wrote: This will not work, if for no other reason that 'companies as c on c.org_nbr = p.org_nbr', etc are not identifiers and it is sql.Identifier. Also it would be simpler for this case just to create a quoted stat

RE: New user questions

2021-07-14 Thread David Raymond
From https://www.psycopg.org/docs/sql.html "The module contains objects and functions useful to generate SQL dynamically, in a convenient and safe way." If there's nothing dynamic about the text of the query, then you don't really need to go through all the trouble of using all those classes. T

Re: New user questions

2021-07-14 Thread Rich Shepard
On Wed, 14 Jul 2021, Adrian Klaver wrote: Where are c.nbr and a.* coming from? If they are supposed to be table qualified values this will not work. Adrian, From the psql shell version. Also it is sql.Identifier. Thanks; I certainly missed that. This will not work, if for no other rea

RE: New user questions

2021-07-14 Thread Rich Shepard
On Wed, 14 Jul 2021, David Raymond wrote: "The module contains objects and functions useful to generate SQL dynamically, in a convenient and safe way." David, There are many examples in the doc and I'm just learning which is appropriate for each of my queries. If there's nothing dynamic abo