public inbox for [email protected]
help / color / mirror / Atom feedFrom: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: Reset sequence to current maximum value of rows
Date: Thu, 13 Jun 2024 11:24:37 -0700 (PDT)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwba=vb16vR47W0oo3SirkJ+UqLEg5j9-fqe+vm=0Q7_qw@mail.gmail.com>
References: <[email protected]>
<CAKFQuwba=vb16vR47W0oo3SirkJ+UqLEg5j9-fqe+vm=0Q7_qw@mail.gmail.com>
On Thu, 13 Jun 2024, David G. Johnston wrote:
> You need to show your work here. As your PK is a number it cannot have a
> company name as a value and so this doesn't make sense.
David,
insert into companies (company_nbr,company_name,industry,status) values
(DEFAULT,'new company name','Industry','Opportunity')
With DEFAULT as the company_nbr why can't the company_name not have a value?
> It didn't...
I changed the company_name for all company_nbr using the 'new company name'
for all rows with 'Industry' in that column.
> And how to I reset sequences to ignore all current values
> This doesn't make sense...
Then I cannot use the sequence for adding new rows in the table and I must
manually enter each PK number?
> If you use the default when inserting the next value in the sequence is
> used.
Yes, that's the theory. It didn't work for me and why it didn't is what I
want to understand.
Regards,
Rich
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: Reset sequence to current maximum value of rows
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