sql - How generate oracle string sequence? -
I need to create a unique identifier which should not be 5 length now, because the number is not correct, there is no Generate unique wire in the Oracle database?
To use numbers in hex hex format
Select from double to to_char (seq.nextval, 'fm0XXXX');
Or to use all the symbols between ASCII code 33 and 122, this more compact method:
num, chr (33 + mod (floor) (Num / (90 * 90 * 90 * 90), 90)) || Chr (33+ mod (floors (number / (90 * 90 * 90)), 90)) || Chr (33+ mod (floors (number / (90 * 90)), 90)) || Chr (33+ mod (floors (number / 90), 90)) || Chr (33+ mod (num, 90)) to x00000 (select seq.nextval as double to num);
Actually this 90-based number is represented.
Comments
Post a Comment