Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: dbms_random&varray

Re: dbms_random&varray

From: William Robertson <williamr2019_at_googlemail.com>
Date: 15 Apr 2007 14:20:54 -0700
Message-ID: <1176672054.567435.321590@n76g2000hsh.googlegroups.com>


On Apr 15, 3:36 pm, Ora_PL <p..._at_onet.eu> wrote:
> Of course thanks for Michel's answer too.
> Both methods working now without any problems.
>
> But I don't know why this version
> made this error ORA-06533 previously.
> Anyway big THX for all.
>
> DECLARE
> V_IN NUMBER(2);
> TYPE table_v IS VARRAY(3) OF NUMBER;
> V_TABLE TABLE_v;
>
> BEGIN
> v_in := dbms_random.VALUE(1,3);
> v_table := TABLE_v(V_IN);
>
> for idx in v_table.first..v_table.last loop
> DBMS_OUTPUT.PUT_LINE(TO_CHAR(v_Table(idx)));
> end loop;
>
> END;
> /

Why would you use a VARRAY as a PL/SQL variable anyway? Wouldn't you use a nested table type? Surely VARRAYs are for multivalue columns in database tables (and I would question why would want to use those either). Received on Sun Apr 15 2007 - 16:20:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US