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



sjl wrote:
Buck -
A cursor defines a record set, correct?

Yes.

To simply, this is what my RPG program does this:

1) Uses 'connect to' to connect to remote database
2) Dynamically prepares an SQL statement to select records from the remote
table
3) Uses the dynamic SQL to open a cursor over the remote table
4) Uses Fetch to fetch a rows from the cursor into a externally-defined data
structure
5) Uses the fields from this data structure to populate a data structure
defined over a local file
6) WRITES a record to the local file.
7) Loops (steps 4-6) until all rows from the cursor are processed
8) Disconnects from the remote database

Right. I have similar needs, but the proposal on MIDRANGE-L was to use
stored procedures, not a dynamic SQL statement.

1) connect to
2) CALL
3) ???

I understand that you have essentially the same file on nnn machines. I
don't. I have slightly different files on each machine, and if I could
do a stored procedure on each one, I could return a common result set
for the central program to consume.

In Java it'd be:
1) getConnection
2) prepareCall / execute
3) getResultSet
4) rs.next
5) manipulate the returned columns
6) INSERT INTO local file
7) loops steps 4-6
8) disconnect / close

It seems funny wanting to do a Java thing in RPG. Yes, I'm sure with
enough effort I could create an interface between Java and RPG, but if I
could directly open a cursor on a result set that was created by a
stored procedure it'd be sweet.
--buck

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.