Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Subscript beyond count ERROR WHILE INSERTING IN A COLLECTION
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