当前位置: > 数据库 > Oracle >

Oracle通过dbms_random.string生成随机字符串

时间:2015-02-08 00:16来源:linux.it.net.cn 作者:IT

官方文档链接:http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_random.htm#i996825

DBMS_RANDOM.STRING用法:

1)选项'u', 'U' - returning string in uppercase alpha characters
2)选项'l', 'L' - returning string in lowercase alpha characters
3)选项'a', 'A' - returning string in mixed case alpha characters
4)选项'x', 'X' - returning string in uppercase alpha-numeric characters
5)选项'p', 'P' - returning string in any printable characters.
6)选项 Otherwise the returning string is in uppercase alpha characters.

例子:

生成由大写字母和数字组成的8位密码

sys@ora11g>select dbms_random.string('x',8) "x_8_password" from dual;

x_8_password

----------------------------------------------

TT3ISGUV

(责任编辑:IT)
------分隔线----------------------------