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



Well, V5R3 QSQLMSG for message ID QSQL0518 says, "Prepared statement &1 not
found," and in my experience it is not used for a number of errors; it's
used for one. That one error is pretty self-explanatory, indicating either
that the PREPARE failed (or was skipped) or that there's a misspelling
involved.

I see that you have a cursor and a prepared SQL statement that share the
same name. This might be OK, but it's something that I usually avoid.

Shouldn't your PREPARE precede your DECLARE? This statement implies that
SQLRRN is already "defined" but it won't be until after its successor
statement has been seen:
DECLARE SQLRRN scroll cursor for SQLRRN

But if that's the issue then you won't get past the compiler. So I guess
I'd start with the job log. What's in the job log that may be of help?
Which line number (from the joblog, not from this review) receives the
SQL0518 error (that'll be in the log), and what is the name of the prepared
statement that is not found? Let's start there.

If that stuff is not in the joblog, make sure your logging level is 4 0
CHGJOB LOGLVL(4 0 *N)

And then try it again. It might also be good to do in DEBUG mode since that
will put more information in the joblog, but in this case I would expect
that to be unnecessary.

This doesn't look like something that needs a PREPARE/EXECUTE combination.
Have you tried without?

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
Flashlight: (n) A case for holding dead batteries.


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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.