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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to assign values to a table of Record Type

Re: How to assign values to a table of Record Type

From: Mladen Gogala <mgogala.spam-me-not_at_verizon.net>
Date: Wed, 29 Nov 2006 13:11:07 GMT
Message-Id: <pan.2006.11.29.13.11.06.458047@verizon.net>


On Wed, 29 Nov 2006 02:42:45 -0800, Rama Shankar wrote:

> Hi,
> I need to assign the tab1 variable as
>
> ABC, 101
> XYZ, 202
>
> type rec is record (nm varchar2(10),id number);
> type tab is table of rec;
> tab1 tab;
>
> Is it possible something like
>
> tab1 tab:= tab(rec('ABC',101),rec('XYZ',202)).
>
> I tried above syntax but got compilation error.
>
> Pls suggest , is there a way to do so.

No, there is no way to do this:
  1 declare
  2 type rec is record (nm varchar2(10),id number);   3 type tab is table of rec;
  4 rec1 rec;
  5 tab1 tab;
  6 begin
  7 rec1.nm:='ABC';
  8 rec1.id:=101;
  9 tab1:=tab(rec1);
 10* end;
SQL> / PL/SQL procedure successfully completed.

-- 
http://www.mladen-gogala.com
Received on Wed Nov 29 2006 - 07:11:07 CST

Original text of this message

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