mardi 8 septembre 2020

Oracle 12c SQL Random String Digits Only Size 10

what's the easiest way to get a 10 character random string containing only numeric characters (digits)? The one below gives something similar but I would like to get strings with left padded zeros also. e.g. 0000000020

SELECT LPAD(REPLACE(TO_CHAR(dbms_random.value(1, 9999999999)),'.',''),10,'0') randomnumstr FROM dual;



Aucun commentaire:

Enregistrer un commentaire