lately I tried to fetch a VARCHAR with a multi row fetch. Unfortunately I didn't managed to do it correctly. Can you help me?
This is the definition of my field (taken from DCLGEN):
03 MY-TEXT. 49 MY-TEXT-LEN PIC S9(4) USAGE COMP. 49 MY-TEXT-TEXT PIC X(1000).
I changed it that way:
03 MY-TEXT OCCURS 100. 49 MY-TEXT-LEN PIC S9(4) USAGE COMP. 49 MY-TEXT-TEXT PIC X(1000).
My multi row fetch looks like this:
EXEC SQL FETCH NEXT ROWSET FROM CMYTEXT FOR 100 ROWS INTO :MY-TEXT END-EXEC
And last but not least, I get the following error from the compiler:
HOST VARIABLE ARRAY 'MY-TEXT' IS EITHER NOT DEFINED OR IS NOT USABLE
What is wrong with my definition for the multi row fetch?
Does somebody see it on the first glance?