Bob,
I suppose if you must use random numbers for IDs, you could do
what you can to generate a random number that is unique, test it
against the target table, and go again if you must... seems kind of
fussy though.
Ben Petersen
On 23 Apr 2001, at 17:25, Bob Powell wrote:
>
> Ladies and Gentlemen:
>
> I see I have instigated a large discussion on
> random numbers. Let me explain where this is coming from.
>
> I have a DBA that feels id numbers which link the
> various database files together should be random in nature.
> I explained that R:base has its own way of
> automatically generating consecutive numbers which
> guarantees uniqueness. I also feel that allowing R:BASE to
> generate the number automatically in the table is better
> than having to write application code to do it. As we all
> know this is a must and R:Base's solution is just fine with
> me.
>
> She feels however that random generating a
> unique id number is a better way to go although I am hard
> pressed to have her explain to me why. So I just wanted to
> know if someone had done something I have never been able
> to do.
>
> Having taken PASCAL 100 years ago I agree with the
> idea that a random generator will eventaually repeat a
> number. I was taught that a random generator should in
> fact repeat the same sequence if the same seed is used.
> Somethimes for testing being able to generate the same
> random sequence is good. At other times it is not, but it
> seems to me that as long as you change the seed the random
> sequence should be different which I think is what you all
> have discovered. This seems perfectly acceptable to me if
> I remeber my training years ago.
>
> Based on the way I understand random generators in all
> languages R:BASE's is responding correctly. I think what
> we all are discovering is that there is not way to randomly
> generate unique numbers. This is OK with me since I feel
> the unique consective numbering allowed in tables works
> just dandy.
>
> Maybe I need to explain to her that sometimes database
> theory needs to be over-riden by practicality. She has it
> in her notes from one of her database instructors that
> random generated id numbers is a good thing.
>
> ----------------------
> Bob Powell
> The Hotchkiss School
> Lakeville, Connecticut
> Systems Administrator
> [EMAIL PROTECTED]
>
>