Use of BY clause in for each causes error#26

aravind.222

New Member
When i run a query that should list me the records sorted by the desired field, i am getting this error#26 which says..

Array subscript 0 is out of range. (26)

The query that i ran is below.

for each customer no-lock by state:
/* processing logic */
end.

my guess is corrupted data/index. Please advice me of possible root cause!!
Appreciate your help!!

- Aravind
 
Does it do this even in your simplistic example above, without any processing? So just a plain for each? How about if you change it to

for each customer no-lock by customer.state:
/* processing logic */
end.
 
FIND FIRST Customer NO-LOCK NO-ERROR.
MESSAGE EXTENT(Customer.State) VIEW-AS ALERT-BOX.

What does this show?
 
Can you dump data from the Customer table and review the .d file - and check for record / data corruption? Or Maybe EXPORT data and then IMPORT it back to a TEMP-TABLE tt (LIKE Customer) and see which record IMPORT failed.
 
yes.. as suspected by us, this is an issue with corrupted data. Actually the size of table is very big that i cant do an export/ import. Instead i did an SQL on it.

Select count(*) from customer.

and the results didnt differ. I got the same error#26 and now i reported it to our DBA.
I thank you and cringer for your quick replies.
 
Back
Top