Generate Upper and Lowercase Alphanumeric Random String in Oracle

前端 未结 6 638
北荒
北荒 2021-02-05 14:55

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

6条回答
  •  一整个雨季
    2021-02-05 15:24

    How about this:

    select translate(dbms_random.string('a', 20), 'abcXYZ', '158249') from dual;
    

    or, even MORE random ;)

    select translate(dbms_random.string('a', 20), dbms_random.string('a',6), trunc(dbms_random.value(100000,999999))) from dual;
    

提交回复
热议问题