I want to declare a varray of number and that should continuasly ask me.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rohullah
    New Member
    • Mar 2010
    • 43

    I want to declare a varray of number and that should continuasly ask me.

    Hello

    I want to declare a varray of number and that should continuasly ask me
    Enter any number:
    like following.

    Enter any Number:10
    Enter any Number:20
    Enter any Number:30
    Enter any Number:40
    Enter any Number:50

    and after this i want to print these numbers on screen.

    This is my code it doesnt work,
    ---------------------------------------------------------
    Declare
    type array1 is varray(5) of number;
    begin
    for i in array1.first..a rray1.last loop
    array1(i):=&Ent er_any_number;
    end loop;
    for t in array1.first..a rray1.last loop
    dbms_output.put _line('The output of array is: '||array1(t));
    end loop;
    end;
    /
    -----------------------------------------------------------

    Please help me ,how to do it?
    looking forword.
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    Would it be always 5 numbers?

    Comment

    • Rohullah
      New Member
      • Mar 2010
      • 43

      #3
      if i declare varray(5) then it should ask 5time else it should ask the varray size tiem.

      Comment

      Working...