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



On 04-Apr-2017 05:00 -0500, Paul Bailey wrote:
I have a stored procedure to create a record in a SQL table. That SQL
table has an auto-identity column which I need to pass back to the
RPG so I used a *data-change-table-reference* (i.e. SELECT <fields>
FROM FINAL TABLE (INSERT ...)) and then used ALLOCATE CURSOR in RPGLE
to retrieve the result set. […]

Seems a lot more work than should be required solely to return an integer value; i.e. why not just pass back the value as an OUT [or INOUT] parameter rather than via a cursor? Or, although not the most appropriate [possibly for a variety of reasons], obtain the value from the IDENTITY_VAL_LOCAL function in the caller. Perhaps just something to consider, to avoid\circumvent the msg CPF5035 RC14 [followed by sqlcode:-138 msg SQL0138 per sqlstate:22011] error, perhaps just until the issue with the current coding can be resolved.?

The o/s version is 7.1. All source, programs and files are on the
same partition […]

FWiW, with a pub400 account the current code could be tested on v7r3.


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.