Home » SQL & PL/SQL » SQL & PL/SQL » Subscript beyond count
Subscript beyond count [message #299314] Mon, 11 February 2008 07:02 Go to next message
sayuri
Messages: 20
Registered: October 2006
Location: Cape Town
Junior Member
I have a script where I'm trying to use a collection and even though I do extend my collection, I still get this error:

ORA-06533: Subscript beyond count
ORA-06512: at line 138

Please see attached file for the relevant script.

Any ideas on what I'm doing wrong here?


Thanks !


Re: Subscript beyond count [message #299327 is a reply to message #299314] Mon, 11 February 2008 07:54 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Are you seriously expecting we will count your lines.
Post with line numbers.

And check:
ORA-06533: Subscript beyond count
 *Cause:  An in-limit subscript was greater than the count of a varray
          or too large for a nested table.
 *Action: Check the program logic and explicitly extend if necessary.

Regards
Michel
Re: Subscript beyond count [message #299342 is a reply to message #299327] Mon, 11 February 2008 09:55 Go to previous messageGo to next message
sayuri
Messages: 20
Registered: October 2006
Location: Cape Town
Junior Member
Michel,

Why do you have to be so rude always ?

I'm quite new to this forum, so sorry for not posting line numbers, but really - you can at least try to be nice sometimes. I have seen many of your posts on this forum and you sound like a real a**hole most of the time ....

I'm sure OraFAQ can find an Oracle expert with a nicer personality .... this cannot be the best that is out there ....

Sad
Re: Subscript beyond count [message #299345 is a reply to message #299314] Mon, 11 February 2008 10:23 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9104
Registered: November 2002
Location: California, USA
Senior Member
When I open your text file in notepad and use edit and goto line number 138, it shows that line as:

t_sys_no (l_tab_row) := r_par.msa_system_no;

So, it would appear that it is saying that l_tab_row is greater than the rows in t_sys_no. Looking at your logic,


      loop
         begin
            ...            
            l_tab_row := l_tab_row + 1;

            select count (*)
              into l_count
              ...;

            if l_count = 0 then
               t_sys_no.extend;
               ...
               t_sys_no (l_tab_row) := r_par.msa_system_no;
               ...
            end if;
         end;
      end loop;


it appears that the problem is that when l_count is not 0, you are incrementing l_tab_row but not extending t_sys_no. So, the next time through the loop that l_count = 0, l_tab_row is greater than the rows in t_sys_no.

Re: Subscript beyond count [message #299346 is a reply to message #299342] Mon, 11 February 2008 10:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Why do you have to be so rude always ?
I'm quite new to this forum, so sorry for not posting line numbers

It is not being new, it is good sense. You ask for help, you at least be nice enough to make job easier to those who can help you.

Quote:
you can at least try to be nice sometimes.

In any case. This is my way of being and I will not change it for you. I'm direct, without any embellishment. I think nice words are just manipulation. I don't want to manipulate you to make you post as I want. I want to make you feel in your soul you've done something wrong. Now, if this has put in your mind that you have to help those who can help you then I have done the job I wanted.

Quote:
you sound like a real a**hole most of the time ...

Don't stay at the first level.

Quote:
I'm sure OraFAQ can find an Oracle expert with a nicer personality ...

I'm also sure and they already are there.

Now, did you check your program?

Regards
Michel


[Updated on: Mon, 11 February 2008 10:29]

Report message to a moderator

Re: Subscript beyond count [message #299421 is a reply to message #299345] Tue, 12 February 2008 00:33 Go to previous messageGo to next message
sayuri
Messages: 20
Registered: October 2006
Location: Cape Town
Junior Member
Thanks Barbara. Your solution worked like magic.

And thanks for actually making the effort to REALLY help me instead of (like others on this forum ....) just trying to show how important you are and not really providing any real support after all ...

Thanks again
Re: Subscript beyond count [message #299427 is a reply to message #299421] Tue, 12 February 2008 00:47 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Your solution worked like magic

Laughing
Nothing magic, just someone who has worked and learned.
Not like others in this forum that just want to be spoonfed and don't want to read the documentation. Wink

By the way, I would to remind you this topic from you: http://www.orafaq.com/forum/mv/msg/89566/268923/102589/#msg_268923

Regards
Michel

[Updated on: Tue, 12 February 2008 00:50]

Report message to a moderator

Re: Subscript beyond count [message #299430 is a reply to message #299427] Tue, 12 February 2008 00:54 Go to previous messageGo to next message
sayuri
Messages: 20
Registered: October 2006
Location: Cape Town
Junior Member
If I made no effort to read the documentation, then you are no better than me, because you also didn't make any effort to help me ... I also could have gotten that error detail off the internet...

at least Barbara made some effort to try and really help me ....

why are you so miserable? its not worth it you know ... life is graet! cheer up!
Re: Subscript beyond count [message #299445 is a reply to message #299430] Tue, 12 February 2008 01:20 Go to previous message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
As LittleFoot says:
"Locked in order to prevent a possible flame war."

Regards
Michel
Previous Topic: Looking for guidlines
Next Topic: FORALL statement not recognized in sqlplus
Goto Forum:
  


Current Time: Fri Feb 14 08:10:43 CST 2025