Oracle DBMS_RANDOM包使用实例
dbms_random是Oracle数据库提供的一个随机函数包。
- snippet.sql
BEGIN dbms_random.initialize(8); dbms_random.seed('test'); END; / SELECT dbms_random.string('U', 5) FROM dual; SELECT dbms_random.string('P', 2) FROM dual; SELECT dbms_random.string('x', 4) FROM dual; SELECT dbms_random.string('a', 2) FROM dual; SELECT dbms_random.string('l', 3) FROM dual; SELECT dbms_random.normal() FROM dual; SELECT dbms_random.normal() FROM dual; SELECT dbms_random.value() FROM dual; SELECT dbms_random.value(10, 15) FROM dual; BEGIN dbms_random.terminate(); END; /
打赏作者以资鼓励: