View previous topic :: View next topic
|
Author |
Message |
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Hi All,
I am doing a multi row fetch from a table which has got a VARCHAR field of 255 maximum lenght. Now I am having a problem, like I am getting only lenth part populated for first occurance of the VARCHAR data. What happens is length part gets pushed into the data part by one byte, for all the remining occurance of this VARCHAR field alone. and lenth is not getting populated correctly!
Code:
Code: |
05 MY-FIELD OCCURS 100 TIMES.
49 MY-FIELD-LENGTH PIC S9(04) COMP.
49 MY-FIELD-DATA PIC X(255). |
I am fetching into var MY-FIELD, the VARCHAR field. Can any body help be with the proble here. I have shown the lenth being entering into the data part below in hex:
Code: |
TESTDATA-11
0ECEECCEC6FF
B35234131011 |
Looking forward to your suggestions! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what does your CURSOR DECLARE and FETCH look like? |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
Try SYNC with the length host variable.
05 MY-FIELD OCCURS 100 TIMES.
49 MY-FIELD-LENGTH PIC S9(04) COMP SYNC.
49 MY-FIELD-DATA PIC X(255). |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Thanks a lot Umesh!
It worked out |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Umesh,
that is definitely a keeper. |
|
Back to top |
|
|
|