Random number generation
701166May 13 2009 — edited May 13 2009Hello All,
We have a requirement like we have to generate unique random numbers with alphanumeric strings whose length is 7.The output should be somewhat like AB1-BC4T.The following are the validations needs to be checked.
1.generate 3 character alphanumeric strings keeping not more that 2 alphabets together.
2.generate 4 character alphanumeric strings keeping not more that 2 alphabets together.
3.Concatenate both the strings with a ‘-‘.
We thought of using the dbms_random.string to generate the random numbers and then do these validations.
How do we ensure that the 7 digit number is always unique (say till 1 million records)? Is there any way other than storing all generated numbers in some temp table and validating from there?
Any other pointers will be highly appreciated.
Regards,
Sumi