View previous topic :: View next topic |
Author |
Message |
HB0 Beginner
Joined: 20 Apr 2005 Posts: 25 Topics: 7
|
Posted: Fri Oct 10, 2008 8:26 am Post subject: Problem after ALLOCATE |
|
|
We have a statement -
EXEC SQL
ALLOCATE D1 CURSOR FOR RESULT SET :AW-LOCATOR
END-EXEC.
After this we have the EVALUATE SQLNAMEC statement.
The cursor name used in the DECLARE statement is CUSTOMERACCOUNT,
whereas SQLNAMEC is returning CUSTOMERACCOUNT...... where .... is Lowvalues for the remaining 15 bytes after the cursor name.
Hence the control in EVALUATE SQLNAMEC
WHEN 'CUSTOMERACCOUNT'
PERFORM PROCESS-FETCH-CUSTOMERACCOUNT
WHEN OTHER
PERFROM ABEND-PARA is getting into other and abending.
I ahven't worked on stored procedures and unable to understand why it is returning low values in this field. We had a DB2 V8 upgrade and this started happening after that. Can we attribute this to that ? We have a temporary workaround for this, but why did this happen and what is a possible permanent solution. The SQLNAMEL field which gives the length of the cursor I believe it returning the total 30 bytes of SQLNAMEC field as length ,irrespective of the cursor length. Appreciate your inputs.
HB0. |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Wed Oct 15, 2008 1:48 pm Post subject: |
|
|
The SQLDA text fields are defined as VARCHAR. I don't think you can depend on values beyond the length that DB2 returns for each field. Try
Code: | EVALUATE SQLNAMEC(1:SQLNAMEL) |
It's possible that IBM changed the way they populate the SQLNAMEC field. I reviewed a pgm I coded for v7, and the pgm is coded as if DB2 would space fill the remainder of the field after the name. I don't have access to v7, so I can't tell for sure.
Incidently, I'm wondering how you're aquiring storage. I didn't like IBM's sample pgm. I wound up using LE services to dynamically aquire storage which I thought simplified the coding and provided more flexibility. |
|
Back to top |
|
|
HB0 Beginner
Joined: 20 Apr 2005 Posts: 25 Topics: 7
|
Posted: Fri Oct 17, 2008 12:25 am Post subject: |
|
|
Thanks Sharon. But I am unable to find any instances of this sort on teh net to confirm that this could be and upgrade issue. |
|
Back to top |
|
|
|
|