Re: Negative Numbers in "Identity" or" Autonumber" fields

From: Christopher Browne <cbbrowne_at_acm.org>
Date: Mon, 19 Mar 2007 23:17:52 -0400
Message-ID: <87mz28y55r.fsf_at_wolfe.cbbrowne.com>


A long time ago, in a galaxy far, far away, "Tam OShanter" <tam_at_oshanter.com> wrote:
> Any thought's on using negative numbers as surrogate primary keys?
>
> Working with some folks who are of the opinion that using ranges such
> as -1,-2,-3 is appropriate for surrogate keys for code tables.
>
> I'm of the opinion that this is impractical, as, you can't show someone -1
> apples or -1 cars (or whatever you are identifying...).
>
> Not seen this before.

Well, then that's as "impractical" as having to store complex values somewhere (e.g. - multiples of the square root of -1). Just because you can't see SQRT(-1) doesn't mean engineers don't have to use the value...

> I realize, as long as these values meet the criteria of being a
> Primary Key (that is unique and not null) there is no problem
> (technically) with this approach.
>
> Thought on this approach as a matter of form?

Well, using negative numbers has the merit that the values cannot clash with the "all positive" values used in some other field. That would seem somewhat nice.

Unfortunately, it's fairly futile, as you only get to partition the integers once in this particular fashion. There are probably more than 2 sets of ranges that you want to have be disjoint...

-- 
wm(X,Y):-write(X),write('_at_'),write(Y). wm('cbbrowne','gmail.com').
http://linuxfinances.info/info/lsf.html
"...It is meaningless to anyone unwilling to commit to forever using a
single  vendor's operating  system.  Historically  that seems  to have
been a bad choice.  Are you convinced that times have changed?"
-- Les Mikesell <les_at_mcs.com>
Received on Tue Mar 20 2007 - 04:17:52 CET

Original text of this message