Re: CAST error during FETCH in SQLRPGLE program
- From: Drew Dekreon <drew_dekreonATchugachelectricDOTcom>
- Date: Fri, 08 Jul 2005 13:17:20 -0800
I wonder about
> C+ IFNULL(B.ALCNO, ' ') = ' ' AND
> C+ (IFNULL(C.ALCNO, ' ') = ' ' OR
> C+ IFNULL(D.ALCNO, ' ') <> ' ')
Is ALCNO numeric by any chance? I think the two values in IFNULL have to be the same type...
the only other problem would be if the variables you're FETCHing into do not match type with the source fields.
SanderP wrote:
All,
I'm having a problem with a sqlrpgle program I'm working on; Following cursor is defined:
C/EXEC SQL C+ DECLARE C00 CURSOR FOR C+ SELECT A.ALCNO , C+ A.ORDNO , C+ A.ORDSNO , C+ A.ORGSNO , C+ A.CSTCD , C+ A.BNCCD , C+ A.PRDCD , C+ A.CLRCD , C+ A.DLVDT , C+ A.ALWHCD , C+ A.ALCAMT , C+ A.CURCOD , C+ A.CSTCDW , C+ A.BNCCDW , C+ A.ORDTP , C+ A.ALCBID C+ FROM ALLOCDTL A C+ LEFT OUTER JOIN ALLOCCAN B C+ ON B.ALCNO = A.ALCNO AND C+ B.ORDNO = A.ORDNO AND C+ B.ORDSNO = A.ORDSNO C+ LEFT OUTER JOIN ALLOCSHP C C+ ON C.ALCNO = A.ALCNO AND C+ C.ORDNO = A.ORDNO AND C+ C.ORDSNO = A.ORDSNO C+ LEFT OUTER JOIN SHPINCAN D C+ ON D.ALCNO = C.ALCNO AND C+ D.ORDNO = C.ORDNO AND C+ D.ORDSNO = C.ORDSNO AND C+ D.SINO = C.SINO AND C+ D.SISNO = C.SISNO C+ WHERE A.CMPID = ' ' AND C+ A.ALWHCD = :P0WHCD AND C+ A.VSRCD = :P0VSRCD AND C+ A.PRDCD = :P0PRDCD AND C+ A.CLRCD = :P0CLRCD AND C+ A.ORDNO >= :C0ORDNO AND C+ IFNULL(B.ALCNO, ' ') = ' ' AND C+ (IFNULL(C.ALCNO, ' ') = ' ' OR C+ IFNULL(D.ALCNO, ' ') <> ' ') C+ ORDER BY A.CSTCD ASC , C+ A.BNCCD ASC , C+ A.ORDNO ASC , C+ A.ORDSNO ASC C/END-EXEC
After this the cursor is opened and the FETCH is done;
* C/EXEC SQL C+ OPEN C00 C/END-EXEC * C DOW NOT(*IN99) * C/EXEC SQL C+ FETCH C00 C+ INTO :S0ALCNO , C+ :S0ORDNO , C+ :S0ORDSNO , C+ :S0ORGSNO , C+ :S0CSTCD , C+ :S0BNCCD , C+ :S0PRDCD , C+ :S0CLRCD , C+ :S0DLVDT , C+ :S0WHCD , C+ :S0VSRCD , C+ :S0ALCAMT , C+ :S0CURCOD , C+ :S0CSTCDW , C+ :S0BNCCDW , C+ :S0ORDTP , C+ :S0ALBDID C/END-EXEC * **
Immediately after the FETCH statement, SQLCOD has code -420.
Message text for this error is: Character in CAST argument not valid.
Cause: A character in the argument for the CAST function was not correct.
Recovery Text: Change the result data type to one that recognizes the characters in the CAST argument, or change the argument to contain a valid representation of a value for the result data type. Try the request again.
I can't seem to find out why this error occurs. Maybe some of the SQL guru's in here can help me :)
Thanks in advance,
Sander
.
- Prev by Date: Re: Secondary Language
- Next by Date: Re: CAST error during FETCH in SQLRPGLE program
- Previous by thread: Re: CAST error during FETCH in SQLRPGLE program
- Next by thread: Re: CAST error during FETCH in SQLRPGLE program
- Index(es):
Relevant Pages
|