Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lottery number generator

afaltynoSep 18 2013 — edited Sep 19 2013

Hi Everyone,

I just bought myself a lottery ticket and as I was driving home why not write a small program to generate my own numbers?  I came up with the following but I can't seem to figure out why I am getting the following error: 

PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

code below.

declare

lot_num  integer;

fst_num   integer;

sec_num   integer;

thrd_num  integer;

begin

for lot in 1..3

loop

select dbms_random.value(00, 59) num into lot_num from dual;

If fst_num is null then

lot_num := fst_num;

elsif sec_num is null then

lot_num := sec_num;

elsif thrd_num is null then

lot_num := thrd_num;

end if;

end loop;

dbms_output.put_line(fst_num, sec_num, thrd_num);  <==== It complains about this line.  I tried the index named "lot"  and the lot_num as a  reference but no luck.

      

end;

/

Thanks for your help in advance.

Regards,

Al

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2013
Added on Sep 18 2013
9 comments
2,038 views