× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Right on, Thanks Peter.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Peter Dow (ML)
Sent: Friday, February 29, 2008 4:49 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: SQL Data conversion or data mapping error - Hex field

Hi Lim,

The DDS manual says Hex fields are treated as character except that they
are not translated, i.e. something like having a ccsid of 65535 on a
character field.

It's probably trying to convert because you're comparing it to
non-character fields, e.g. :reqHExt.UHFrmDtInEpoch. What are these
fields defined as? Can you use DIGITS or CHAR on them to convert them
to character?

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /


Lim Hock-Chai wrote:
I've a file with a lot of fields declared as Hex type. These hex
fields seems to causing my SQLRPGLE program to error out with SQL0802.

This appears to be cause by sql is trying to convert those Hex fields
into integer. Is there a way to prevent this conversion from taking
place?

Below is what the error looks like:
Cursor ECDHDRCURSOR opened.
Select or omit error on field (Cast(ECDHDR_1.XMITEPOCH[1], Char
Pad(x40,x4040)) AS 4-byte int) member HR0108.
Select/omit error on member HR0108.
Select/omit error on member HR0108.
Data conversion or data mapping error.



Below is portion of the file DDS looks like
A R RECDHDR
A SUB 4H
A XMITEPOCH 4H
A TCAPCODE 4H
A RECNO 9B 0
A LW5 4H




Below is what how I declared the sql cursor:
declare ECDHDRCursor cursor for
select * from ECDHDR a
where
a.XMITEPOCH >= :reqHExt.UHFrmDtInEpoch and

a.XMITEPOCH >= :reqHExt.UHToDtInEpoch and

exists
(select 1 from qtemp/customerList b
where
b.LW10 = a.LW10
) and

exists
(select 1 from qtemp/tidSubList c
where
c.tid = a.tid
)



Below is what the fetch looks like
fetch from ECDHDRCursor into :CDRH

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.