× 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.



Using embedded SQL in RPG IV.  V5R2M0.....

I get an SQLCOD = -000000303 with SQLSTT = '42806' which is telling me I have a host variable that is incompatible ("A value cannot be assigned to a host variable, because the data types are not compatible.")

OK...that doesn't surprise me, I have some numeric data coming in and I guess that I defined the host variable incorrectly.

So, two questions arise:

1.How can I tell which, of the 11 fields in my select statement, is causing the error? and...

2. Is there an "easy" way to define host variables (or some 'trick' I can use) so that my selected fields from the tables match the host variables I select them into?

Am I making this too hard? In Java I can "point" my results to a result set (rs) and then access them using rs.field1, rs.field2, rs.field3, etc. Mapping the select statement into host variables is a drag in RPG. Perhaps there is an easier way? I am all ears....

Thanks,

Pete Helgren



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.