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: Subscript beyond count ERROR WHILE INSERTING IN A COLLECTION

Re: Subscript beyond count ERROR WHILE INSERTING IN A COLLECTION

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Mon, 20 Dec 2004 16:46:01 -0800
Message-ID: <41c7714c$1_3@127.0.0.1>


testmirora_at_hotmail.com wrote:

> Hi,
>
> COULD ANYBODY HELP ME UNDERSTAND THIS ERROR PLEASE,
>
> I'm trying to initialize a collection ALREADY DEFINE.
>
> DESC SEARCH_X;
>
> SEARCH_X TABLE OF SEARCH_P_TYPE
> Name Null? Type
> ------------------------- -------- --------
> ID VARCHAR2(10)
> VALUE VARCHAR2(90)
>
> and then I ADD SOME VALUES TO THE SEARCH_X:
>
> DECLARE
>
> c_tab SEARCH_X := SEARCH_X();
> c_count number (5);
>
> BEGIN
> c_tab(1).ID := '100000';
> c_tab(1).VALUE := 'TRYING TO TEST ';
> c_count := c_tab.count;
> DBMS_OUTPUT.PUT_LINE('C_COUNT VALUE IS ' || TO_CHAR(c_count));
> END;
> /
>
> AND I GET THIS ERROR :
> ERROR at line 1:
> ORA-06533: Subscript beyond count
> ORA-06512: at line 7
>
> WHAT COULD BE BEYOND COUNT HERE AS THE STRING'SIZE RESPECT THE
> DECLARATION ?
>
> THANK YOU ALL.
In addition to Tom Kyte's comment, perhaps also something like this:

CREATE OR REPLACE TYPE InStrTab IS TABLE OF VARCHAR2(4000); /

DECLARE stringary InStrTab;

BEGIN

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------

   http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- Received on Mon Dec 20 2004 - 18:46:01 CST

Original text of this message

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