|
I'll sometimes use SQLCLI instead of imbedded SQL for just these reasons. SQLCLI is essentially an internal ODBC interface AS400 programmers can use to access tables on the AS400. The interface is much like JDBC. You can declare a cursor, open it, access a record(row) from the cursor and then access the fields from the row, just like you can in JDBC. I've only used SQLCLI in C. You'll have to work some to prototype the functions in RPG. And it's been some time since I used it in any new code; I couldn't swear it's still supported in the newer versions. Dan Pete Helgren <Pete@xxxxxxxxxx> Sent by: midrange-l-bounces@xxxxxxxxxxxx 04/08/2005 01:51 PM Please respond to Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> To Midrange Mailing List <MIDRANGE-L@xxxxxxxxxxxx> cc Subject SQL Error SQLCOD = -000000303 SQLSTT = '42806' 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 -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.