ibm-information-center/dist/eclipse/plugins/i5OS.ic.ddp_5.4.0.1/rbal1ddmsql.htm

100 lines
5.5 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="DDM files and SQL" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.subject" content="commitment control, with distributed relational database and DDM jobs, DDM files, SQL commitment control, application server, commitment control for DDM jobs, application requester" />
<meta name="keywords" content="commitment control, with distributed relational database and DDM jobs, DDM files, SQL commitment control, application server, commitment control for DDM jobs, application requester" />
<meta name="DC.Relation" scheme="URI" content="rbal1progdrd.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/cpyf.htm" />
<meta name="DC.Relation" scheme="URI" content="../ddm/rbae5kickoff.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal1ddmsql" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>DDM files and SQL</title>
</head>
<body id="rbal1ddmsql"><a name="rbal1ddmsql"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">DDM files and SQL</h1>
<div><p>You can use <span class="keyword">iSeries™</span> 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.</p>
<p>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 <a href="rbal1setup.htm#rbal1setup">Initial setup</a>.</p>
<div class="p">The following example shows how you can add a relational database directory
entry and create a DDM file so that the same job can be used on the application
server (AS) and application requester (AR). <div class="note"><span class="notetitle">Note:</span> Either both connections
must be protected or both connections must be unprotected for the conversation
to be shared.</div>
</div>
<div class="note"><span class="notetitle">Note:</span> By using the code examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
<pre><strong>Relational Database Directory:</strong>
ADDRDBDIRE RDB(KC000) +
RMTLOCNAME(KC000)
TEXT('Kansas City regional database')</pre>
<pre><strong>DDM File:</strong>
CRTDDMF FILE(SPIFFY/UPDATE)
RMTFILE(SPIFFY/INVENTORY)
RMTLOCNAME(KC000)
TEXT('DDM file to update local orders')</pre>
<p>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:</p>
<pre>
CRTSQL<em>xxx</em> 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;</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal1progdrd.htm" title="Programming considerations for a distributed relational database application on an iSeries server fall into two main categories: those that deal with a function that is supported on the local server and those that are a result of having to connect to other servers.">Programming considerations for a distributed relational database application</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../ddm/rbae5kickoff.htm">Distributed data management</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../cl/cpyf.htm">Copy File (CPYF) command</a></div>
</div>
</div>
</body>
</html>