Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Declaring a global table in PL/SQL
absinth wrote:
> Why can't I have?
>
> CREATE OR REPLACE PACKAGE BODY test AS
> TYPE test_table IS TABLE OF VARCHAR2(30)
> INDEX BY VARCHAR2(2);
>
> DEMO_TABLE test_table;
> DEMO_TABLE('NO') := 'No';
>
> END test;
> /
You can - as the responses show.
But there is nothing "table" about PL/SQL "tables". The *CORRECT* definition is dynamic arrays. And is what is used in every other programming language out there.
There's also a huge questionmark about why wanting to declare a global dynamic array. 99% of the time is nothing but a brain fart that is without substance and plain stinks. Where is the best place for data in Oracle to reside? And the "in-a-global-dynamic-array" answer to that is few and very far in-between.
-- BillyReceived on Thu Aug 04 2005 - 03:08:50 CDT