[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Getting an Oracle random number from SQR



I'm trying to use the Oracle DBMS_RANDOM package to generate a random number
and return it to an SQR variable. I've tried the sample code I've found in
the SQRUG library without any luck. Any help in correcting the following
code would be appreciated:


begin-procedure get_rand

    begin-sql
        call DBMS_RANDOM.initialize(TO_NUMBER(TO_CHAR(SYSDATE, 'SSSSS')));;
        #rand := DBMS_RANDOM.random;;
    end-sql

   move #rand to $rand 009

end-procedure get_rand