Re: Definging columns for INSERT statements

2024-06-13 Thread Rich Shepard
On Wed, 12 Jun 2024, Adrian Klaver wrote: The 'Examples' section at the bottom of this page: https://www.postgresql.org/docs/current/sql-insert.html is a useful resource. Adrian, That's good to know. Thank you. Regards, Rich

Re: Definging columns for INSERT statements

2024-06-12 Thread Adrian Klaver
On 6/12/24 16:24, Rich Shepard wrote: On Wed, 12 Jun 2024, Adrian Klaver wrote: Assuming 'people_person_nbr_seq' is the sequence attached to person_nbr and the other DEFAULTs are the column defaults then the syntax would be: INSERT INTO people (person_nbr, lname, fname, job_title, company_nbr,

Re: Definging columns for INSERT statements

2024-06-12 Thread Rich Shepard
On Wed, 12 Jun 2024, Adrian Klaver wrote: Assuming 'people_person_nbr_seq' is the sequence attached to person_nbr and the other DEFAULTs are the column defaults then the syntax would be: INSERT INTO people (person_nbr, lname, fname, job_title, company_nbr,loc_nbr, direct_phone, cell_phone,emai

Re: Definging columns for INSERT statements

2024-06-12 Thread Adrian Klaver
On 6/12/24 14:11, Rich Shepard wrote: I have > 100 rows to add to a table using INSERT INTO statements. I want the PK to be the next value in the sequence. Would this be the appropriate syntax for the columns to be entered? INSERT INTO people (person_nbr DEFAULT('people_person_nbr_seq'),lname,

Re: Definging columns for INSERT statements

2024-06-12 Thread Rich Shepard
On Wed, 12 Jun 2024, David G. Johnston wrote: INSERT INTO people (person_nbr DEFAULT('people_person_nbr_seq'),lname,fname,job_title DEFAULT 'Contact',company_nbr,loc_nbr,direct_phone,cell_phone,email,active DEFAULT('true')) VALUES https://www.postgresql.org/docs/current/sql-insert.html Not s

Re: Definging columns for INSERT statements

2024-06-12 Thread David G. Johnston
On Wed, Jun 12, 2024 at 2:11 PM Rich Shepard wrote: > I have > 100 rows to add to a table using INSERT INTO statements. I want > the > PK to be the next value in the sequence. Would this be the appropriate > syntax for the columns to be entered? > The whole point of the server is to parse text a

Definging columns for INSERT statements

2024-06-12 Thread Rich Shepard
I have > 100 rows to add to a table using INSERT INTO statements. I want the PK to be the next value in the sequence. Would this be the appropriate syntax for the columns to be entered? INSERT INTO people (person_nbr DEFAULT('people_person_nbr_seq'),lname,fname,job_title DEFAULT 'Contact',compa