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



I have a relatively simple SQL statement that works fine in interactive SQL
and iNavigator.



However, in a RPG program (free form) that is using a prepare and EXECUTE,
the EXECUTE fails with error -518.



This error is used for a number of errors by IBM and I cannot find a
specific error code indicating the problem.



Select RRN(A1) from OEDTL01P A1 right outer join AA0000219 B1 on A1.ODORD =
B1.LORD and A1.ODLINE = B1.LLINE where RRN(B1) = 55243



Here is the code:



Exec Sql Declare SQLRRN scroll cursor for SQLRRN;

Exec Sql Prepare SQLRRN from :SqlRRNPrep;



If SqlCod < 0;

ErrorStatus = '1003';

p1SqlCmd = sqlRRNPrep;

logACTerr ('1003' : SqlCod : p1SqlCmd );

ReturnCode = *off ;// Failed

Return ReturnCode;

Else;

Exec Sql Execute SQLRRN ;

If SqlCod < 0;

ErrorStatus = '1004';

ENDIF;



I get error 1004 with SqlCod = -518.



The code is all in one program/module.



I am using V5R3.



Darryl Freinkel

Assignment 400 Group, Inc.

Tel: 770.321.8562 ext 111 | Fax 770.321.8562 | 2247 La Salle Dr, Marietta
GA, 30062, USA | PO Box 72556, Marietta, GA 30007-2556




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.