× 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 written a program that retrieves record-level data from files on one
LPAR (as the source) and inserts rows to the local files LPAR (as the
target). I have been getting SQL0519 errors that appear, speculatively on
my part, to be caused when the SQE on the source LPAR appears to not close
its cursor for a previously issued Select statement.

It happens intermittently. For example, I may have to retrieve data for
100 files (at a record-select level by specific field values) and the
program will process 40 SQL's but then throw a -519 for the next 60. When
the program gets the -519 all subsequent SQL-Selects throw the same error.
When I log off and restart the program it will show me the 60 that were
not completed (after calling the program and refreshing my subfile list)
but then throw a -519 after processing 20 SQLs. This is all being done
through a interactive program so that the user can accept, or exclude, file
gets from a list. The format of the SQLs is all the same.

exec sql insert into *local_library.local_file*
select * from* source_dbname.source_library.source_file *where
*source_field = value*

then EXECUTE IMMEDIATE.

Here are some real examples (same local library, same remote system &
library):

Insert into ARENTITY.CUPPC select * from PRISMSYS.ARENTITY.CUPPC where
trim(PCCO) = trim('9830')

Insert into ARENTITY.CUPCRGRP select * from PRISMSYS.ARENTITY.CUPCRGRP
where trim(CGCO) = trim('9830')

Insert into ARENTITY.CUPVL select * from PRISMSYS.ARENTITY.CUPVL where
trim(VLVER) = trim('983')

The interactive job log shows this message:

Prepared statement _ in use. *(where the statement is blank)*
This statement is the SELECT statement for cursor _ that is currently
open. *(where
the cursor name is blank)*

I have done lots of research over the last two days and my colleagues are
at a loss also. Please, please, help if you can.

Gratefully,

Robert Wenzel
Developer
Inmar, Inc.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.