If that is your problem, then you have two choices. Make the field packed or
cast the packed field to a numeric(6,0). Whether other fields are zoned
should be immaterial. You couldn't even measure the time difference for the
system converting or not.

On Tue, Aug 10, 2010 at 9:15 AM, Bryce Martin <BMartin@xxxxxxxxxxxx> wrote:

I am getting an SQL7919 - Data conversion required on Fetch with Reason 2.
The host variable is a numeric type that is different than the type of
the value being retrieved.

Here is what I'm doing...
I have a Procedure called FetchNextItem.

36 DFetchNextItem...
37 D PR n
38 D queryDS...
39 D LikeDS(C1ResultSet)

67 DC1ResultSet...
68 D ds
69 D C1mid...
70 D 2a
71 D C1mord...
72 D 6s 0
73 D C1mseq...
74 D 3s 0
75 D C1mprod...
76 D 15a
77 D C1mqreq...
78 D 11s 3
79 D C1mqiss...
80 D 11s 3
81 D C1mqall...
82 D 11s 3
83 D C1maprd...
84 D 15a

So the problem is that C1mord is defined as 6s 0 and the data coming from
the DB in sql is packed. Is there a way around this? I understand what
is happening, I'm just not sure what to do about it. I don't really want
to make C1mord packed because I'm using it with zoned fields everywhere
else. Would I have to do this with all of my numeric fields? Should I be
casting the variables on my select statement?

Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
--- This message (including any attachments) is intended only for the use
of the individual or entity to which it is addressed and may contain
information that is non-public, proprietary, privileged, confidential, and
exempt from disclosure under applicable law. If you are not the intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited. If
you have received this communication in error, please notify us and destroy
this message immediately. ---
--
This is the RPG programming on the IBM i / System i (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 ...

Follow-Ups:
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.