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: Index-by table - compilation errors

Re: Index-by table - compilation errors

From: <fitzjarrell_at_cox.net>
Date: Wed, 06 Jun 2007 07:55:53 -0700
Message-ID: <1181141753.262953.260740@w5g2000hsg.googlegroups.com>


On Jun 6, 9:40 am, "Vojta" <r..._at_centrum.cz> wrote:
> Please, can you advise? I created package in which I defined type:
>
> TYPE StrListTyp IS TABLE OF VARCHAR(255) INDEX BY BINARY_INTEGER;
>
> Package was created, it works, procedures can work with this type. Then I
> tried to create the same type outside package by executing script:
>
> CREATE OR REPLACE TYPE StrListTyp IS TABLE OF VARCHAR(255) INDEX BY
> BINARY_INTEGER;
>
> Type is created with warning: "Warning: TYPE created with compilation
> errors". When I try to run procedure using this type I get error "Object
> [procedure name] is invalid". If I run the script without "INDEX BY", type
> is created without wornings but indexing does not work:
>
> CREATE OR REPLACE TYPE StrListTyp IS TABLE OF VARCHAR(255);
>
> CREATE PROCEDURE MyProc IS
> strList StrListTyp := StrListTyp();
> BEGIN
> strList(1) := 'ABC'; -- Here I get error "Lower index exceeds counter"
> END;
>
> Please, what do I do wrong? How can I create index-by table outside package?
>
> Thank you! Vojta

Such tables are PL/SQL constructs, not physical Oracle objects. They are valid within the scope of a procedure, function or package. They are not valid outside of PL/SQL.

David Fitzjarrell Received on Wed Jun 06 2007 - 09:55:53 CDT

Original text of this message

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