Re: Force randomize within a set of numbers

From: Tiago <diariodastrilhas_at_gmail.com>
Date: Fri, 4 Dec 2009 09:10:35 -0800 (PST)
Message-ID: <89fb1ffe-40ca-4688-b898-b812ea9c09b3_at_k4g2000yqb.googlegroups.com>



On Dec 4, 9:38 am, Tiago <diariodastril..._at_gmail.com> wrote:

simplified, don't know what I was thinking when did version 1.0.

SET serveroutput ON
DECLARE
Type tabIntegers
IS
  TABLE OF NUMBER ;
  Integers tabIntegers ;
  rndInteger NUMBER ;
BEGIN
  integers := tabIntegers( 2, 5, 10, 7, 3, 8, 11, 25, 0 ) ;   rndInteger := integers(TRUNC( dbms_random.value (1,integers.last) ) ) ;
  dbms_output.put_line(rndInteger);
END ;

  • T
Received on Fri Dec 04 2009 - 11:10:35 CST

Original text of this message