You can use iSeries™ distributed data management (DDM) support to help you do some distributed relational database tasks within a program that also uses SQL distributed relational database support.
It might be faster, for example, for you to use DDM and the Copy File (CPYF) command to get a large number of records rather than an SQL FETCH statement. Also, DDM can be used to get external file descriptions of the remote system data brought in during compilation for use with the distributed relational database application. To do this, you need to use DDM as described in Initial setup.
Relational Database Directory: ADDRDBDIRE RDB(KC000) + RMTLOCNAME(KC000) TEXT('Kansas City regional database')
DDM File: CRTDDMF FILE(SPIFFY/UPDATE) RMTFILE(SPIFFY/INVENTORY) RMTLOCNAME(KC000) TEXT('DDM file to update local orders')
Here is a sample program that uses both the relational database directory entry and the DDM file in the same job on the remote server:
CRTSQLxxx PGM(PARTS1) COMMIT(*CHG) RDB(KC000) RDBCNNMTH(*RUW) PROC :PARTS1; OPEN SPIFFY/UPDATE; . . . CLOSE SPIFFY/UPDATE; . . . EXEC SQL SELECT * INTO :PARTAVAIL FROM INVENTORY WHERE ITEM = :PARTNO; EXEC SQL COMMIT; . . . END PARTS1;