Re: building substrings

2004-09-15 Thread John W. Krahn
David Gilden wrote: Hello, Hello, I am building a primary key for a database, and I guess the first question would be how safe is a key made from the last 4 digits of a social security num and the first 3 letters of the last name. Do you mean safe as in unique? Or do you mean safe because you ar

Re: building substrings

2004-09-15 Thread Gunnar Hjalmarsson
David Gilden wrote: $ss = '1234567890'; $lname = 'Gilden'; # $pkey = substr($ss,length($ss)-4,length($ss)) . substr($lname,0,3); Why not just: $pkey = substr($ss, -4) . substr($lname,0,3); $ss = '09876543'; $lname = 'Smith'; # this line is bad! -- trying to have the same functionality as th

Re: building substrings

2004-09-15 Thread Wiggins d Anconia
> Hello, > > I am building a primary key for a database, and I guess the first question would be > how safe is a key made from the last 4 digits of a social security num and the first > 3 letters of the last name. I would guess not very, but I don't know what your target sample size is. I kn

RE: building substrings

2004-09-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Gilden wrote: > Hello, > > I am building a primary key for a database, and I guess the first > question would be > how safe is a key made from the last 4 digits of a social security > num and the first 3 letters of the last name. Now for the PERL > question, I have substr. line working cor

building substrings

2004-09-15 Thread David Gilden
Hello, I am building a primary key for a database, and I guess the first question would be how safe is a key made from the last 4 digits of a social security num and the first 3 letters of the last name. Now for the PERL question, I have substr. line working correctly. I wanted to try it with