DBMS_RANDOM

1997 단어 dbms_random
개발 과정 에서 난수 수요 가 자주 발생 하 는데 Oacle 자체 가 가지 고 있 는 기능 은 이러한 기능 이 있 습 니 다. 이 기능 을 가 진 가방 DBMS 를 소개 합 니 다.RANDOM, 주로 공식 문서 로 설명 합 니 다.
The  DBMS_RANDOM  package provides a built-in random number generator.
이 가방 에는 몇 개의 서브루틴 이 포함 되 어 있 습 니 다. 여기 에는 두 개의 서브루틴 만 소개 합 니 다.
RANDOM function
This procedure is deprecated. Although currently supported, it should not be used. It generates and returns a random number.
Syntax
DBMS_RANDOM.RANDOM
   RETURN binary_integer;

Return value
A random  BINARY_INTEGER  value greater than or equal to  -power(2,31)  and less than  power(2,31)
VALUE function
One version returns a random number, greater than or equal to 0 and less than 1, with 38 digits to the right of the decimal (38-digit precision). The other version returns a random Oracle Database  NUMBER  value  x , where  x  is greater than or equal to the specified  low  value and less than the specified  high  value.
Syntax
DBMS_RANDOM.VALUE
  RETURN NUMBER;

DBMS_RANDOM.VALUE(
  low  IN  NUMBER,
  high IN  NUMBER)
RETURN NUMBER;

Parameters
Parameter
Description low
Lower limit of the range in which to generate a random number high
Upper limit of the range in which to generate a random number
Return value
NUMBER  value that is the generated random number
예: round (dbms random. value (0, 18), 0)  0 보다 크 고 18 보다 작은 정수 로 돌아 갈 수 있다.

좋은 웹페이지 즐겨찾기