Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: table datatype problem
"Kamil" <kamil_bradler_at_hotmail.com> wrote in message
news:76c57518.0110220312.5f3ac3b3_at_posting.google.com...
> Hi everyone,
> why I cannot run these two short PLSQL blocks? It's idealized case of
> my complicated query.
>
> declare cursor c1 is select 1,2 from dual;
> type fan is table of c1%rowtype;
> fak fan;
> begin open c1;
> fetch c1 into fak;
> close c1; end;
>
> and the same:
>
> declare cursor c1 is select 1,2 from dual;
> type eh is record (a number, b number);
> type fan is table of eh;
> fak fan;
> begin open c1;
> fetch c1 into fak;
> close c1; end;
>
> The problem isn't in the declarating part, but in the executing
> (fetch) part.
> Thank you very much.
> Kamil
You can't fetch *directly* into a pl/sql table, so one way or another the problem *is* in the declarating part as fak is of the wrong type. The obvious solution is to read up on pl/sql tables, fetch into a cursor%rowtype, and so on.
Regards,
Sybrand Bakker
Senior Oracle DBA
Received on Mon Oct 22 2001 - 07:04:56 CDT