Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    7

    Unanswered: can't use dbms_random.value in a sql statement!!

    for exampleË


    select dbms_random.value from dual;


    error message is "invalid colomn"


    is it possible to put package function is a sql statement?if true,how?


    cheers

  2. #2
    Join Date
    Sep 2002
    Location
    Austria
    Posts
    37
    it should work - have a look at the following.

    SQL> select dbms_random.value from dual;

    VALUE
    ----------
    ,300778838

    SQL> desc dbms_random
    PROCEDURE INITIALIZE
    Argument Name Typ In/Out Defaultwert?
    ------------------------------ ----------------------- ------ --------
    VAL BINARY_INTEGER IN
    FUNCTION NORMAL RETURNS NUMBER
    FUNCTION RANDOM RETURNS BINARY_INTEGER
    PROCEDURE SEED
    Argument Name Typ In/Out Defaultwert?
    ------------------------------ ----------------------- ------ --------
    VAL BINARY_INTEGER IN
    PROCEDURE SEED
    Argument Name Typ In/Out Defaultwert?
    ------------------------------ ----------------------- ------ --------
    VAL VARCHAR2 IN
    FUNCTION STRING RETURNS VARCHAR2
    Argument Name Typ In/Out Defaultwert?
    ------------------------------ ----------------------- ------ --------
    OPT CHAR IN
    LEN NUMBER IN
    PROCEDURE TERMINATE
    FUNCTION VALUE RETURNS NUMBER
    FUNCTION VALUE RETURNS NUMBER
    Argument Name Typ In/Out Defaultwert?
    ------------------------------ ----------------------- ------ --------
    LOW NUMBER IN
    HIGH NUMBER IN

    SQL> execute dbms_random.initialize(14);

    PL/SQL-Prozedur wurde erfolgreich abgeschlossen.

    SQL> select dbms_random.value from dual;

    VALUE
    ----------
    ,479337823

    SQL> select dbms_random.value from dual;

    VALUE
    ----------
    ,457161279

    SQL> select dbms_random.value from dual;

    VALUE
    ----------
    ,211695489

    SQL>

    ----
    I am running Oracle 9.2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •