Re: [GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread Rich Shepard
On Thu, 11 Aug 2011, Steve Atkins wrote: This will fail if any of the existing values are integers in the range that you're inserting - and it may fail in the future, as you add new records if they clash with existing entries. Steve/Chris/Dave: I had not looked in deatil at that column befo

Re: [GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread Steve Atkins
On Aug 11, 2011, at 12:34 PM, Rich Shepard wrote: > On Thu, 11 Aug 2011, Chris Travers wrote: > >> The simplest seems to me to be a sequence and use nextval() to populate >> the null values. The major advantage would be that the sequence could stay >> around in case you need it again. So for exa

Re: [GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread David Johnston
On Aug 11, 2011, at 15:08, Chris Travers wrote: > On Thu, Aug 11, 2011 at 11:47 AM, Rich Shepard > wrote: >> I've a table (from a client, not created here) with a column that should >> be the primary key, but not all rows have a value for this attribute. The >> column format is VARCHAR(12) and

Re: [GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread Chris Travers
On Thu, Aug 11, 2011 at 12:34 PM, Rich Shepard wrote: > On Thu, 11 Aug 2011, Chris Travers wrote: > >> The simplest seems to me to be a sequence and use nextval() to populate >> the null values. The major advantage would be that the sequence could stay >> around in case you need it again. So for e

Re: [GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread Rich Shepard
On Thu, 11 Aug 2011, Chris Travers wrote: The simplest seems to me to be a sequence and use nextval() to populate the null values. The major advantage would be that the sequence could stay around in case you need it again. So for example: create sequence my_varchar_values; UPDATE my_table se

Re: [GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread Chris Travers
On Thu, Aug 11, 2011 at 11:47 AM, Rich Shepard wrote: >  I've a table (from a client, not created here) with a column that should > be the primary key, but not all rows have a value for this attribute. The > column format is VARCHAR(12) and has a variety of values, such as 96-A000672 > and 9612-08

[GENERAL] Filling Missing Primary Key Values

2011-08-11 Thread Rich Shepard
I've a table (from a client, not created here) with a column that should be the primary key, but not all rows have a value for this attribute. The column format is VARCHAR(12) and has a variety of values, such as 96-A000672 and 9612-0881 (probably assigned by different analytical laboratories).