How does one generate an upper and lowercase alphanumeric random string from oracle?
I have used select DBMS_RANDOM.STRING(\'x\', 10) from dual
to generate
You could start with the Printable option, then strip out any non-alphanumerics:
select SUBSTR(
TRANSLATE(dbms_random.string('p',100)
,'A`~!@#$%^&*()-=_+[]\{}|;'':",./<>?'
,'A')
,1,10) from dual;
(Note: very rarely, this will return less than 10 characters)
or, map the offending characters to other letters and numbers (although this would reduce the randomness quite a bit):
select TRANSLATE(dbms_random.string('p',10)
,'A`~!@#$%^&*()-=_+[]\{}|;'':",./<>? '
,'A' || dbms_random.string('x',33)) from dual;
Great question, by the way.
Now, for my bonus points:
The reason Oracle didn't implement this is because no-one asked for it, and it probably is not a high priority.