85 lines
6.4 KiB
HTML
85 lines
6.4 KiB
HTML
|
<?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="Transaction processing task in a DB2 UDB CLI application" />
|
||
|
<meta name="abstract" content="This topic shows a typical order of function calls in a DB2 UDB CLI application." />
|
||
|
<meta name="description" content="This topic shows a typical order of function calls in a DB2 UDB CLI application." />
|
||
|
<meta name="DC.subject" content="SQLAllocStmt, function, overview, SQLBindCol, function, SQLColAttributes, function, SQLDataSources, function, SQLDescribeCol, function, SQLExecDirect, function, SQLExecute, function, SQLFetch, function, SQLFreeStmt, function, SQLGetData, function, SQLNumResultCols, function, SQLPrepare, function, SQLRowCount, function, SQLSetParam, function, SQLTransact, function" />
|
||
|
<meta name="keywords" content="SQLAllocStmt, function, overview, SQLBindCol, function, SQLColAttributes, function, SQLDataSources, function, SQLDescribeCol, function, SQLExecDirect, function, SQLExecute, function, SQLFetch, function, SQLFreeStmt, function, SQLGetData, function, SQLNumResultCols, function, SQLPrepare, function, SQLRowCount, function, SQLSetParam, function, SQLTransact, function" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzadphdovv.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzadpallocate.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzadpprepexec.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzadpprocessresults.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzadpfreestatementhandles.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzadpcommitrollback.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rzadphdptran" />
|
||
|
<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>Transaction processing task in a DB2 UDB CLI application</title>
|
||
|
</head>
|
||
|
<body id="rzadphdptran"><a name="rzadphdptran"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Transaction processing task in a DB2 UDB CLI application</h1>
|
||
|
<div><p>This topic shows a typical order of function calls in a DB2<sup>®</sup> UDB CLI application.</p>
|
||
|
<div class="p">The typical order of function calls in a DB2 UDB CLI application
|
||
|
is shown in the following figure. The figure does not show all functions or
|
||
|
possible paths. <div class="fignone" id="rzadphdptran__fgovvc"><a name="rzadphdptran__fgovvc"><!-- --></a><span class="figcap">Figure 1. Transaction processing</span><br /><img src="rv3w323.gif" alt="Transaction Processing" /><br /></div>
|
||
|
</div>
|
||
|
<div class="p">The figure shows the steps and the DB2 UDB CLI functions in the transaction
|
||
|
processing task. This task contains these steps:<ol><li><a href="rzadpallocate.htm#rzadpallocate">Allocate statement handle(s) in a DB2 UDB CLI application</a></li>
|
||
|
<li><a href="rzadpprepexec.htm#rzadpprepexec">Preparation and processing tasks in a DB2 UDB CLI application</a></li>
|
||
|
<li><a href="rzadpprocessresults.htm#rzadpprocessresults">Processing results in a DB2 UDB CLI application</a></li>
|
||
|
<li><a href="rzadpfreestatementhandles.htm#rzadpfreestatementhandles">Free statement handles in a DB2 UDB CLI application</a></li>
|
||
|
<li><a href="rzadpcommitrollback.htm#rzadpcommitrollback">Commit or roll back in a DB2 UDB CLI application</a></li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
<p>The function SQLAllocStmt is needed to obtain a statement handle that is
|
||
|
used to process the SQL statement. There are two methods of statement processing
|
||
|
that can be used. By using SQLPrepare and SQLExecute, the program can break
|
||
|
the process into two steps. The function SQLBindParameter is used to bind
|
||
|
program addresses to host variables used in the prepared SQL statement.
|
||
|
The second method is the direct processing method in which SQLPrepare and
|
||
|
SQLExecute are replaced by a single call to SQLExecDirect.</p>
|
||
|
<p>As soon as the statement is processed, the remaining processing depends on the
|
||
|
type of SQL statement. For SELECT statements, the program uses functions like
|
||
|
SQLNumResultCols, SQLDescribeCol, SQLBindCol, SQLFetch, and SQLCloseCursor
|
||
|
to process the result set. For statements that update data, SQLRowCount can
|
||
|
be used to determine the number of affected rows. For other types of SQL statements,
|
||
|
the processing is complete after the statement is processed. SQLFreeStmt is
|
||
|
then used in all cases to indicate that the handle is no longer needed.</p>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rzadpallocate.htm">Allocate statement handle(s) in a DB2 UDB CLI application</a></strong><br />
|
||
|
</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzadpprepexec.htm">Preparation and processing tasks in a DB2 UDB CLI application</a></strong><br />
|
||
|
</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzadpprocessresults.htm">Processing results in a DB2 UDB CLI application</a></strong><br />
|
||
|
</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzadpfreestatementhandles.htm">Free statement handles in a DB2 UDB CLI application</a></strong><br />
|
||
|
</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzadpcommitrollback.htm">Commit or roll back in a DB2 UDB CLI application</a></strong><br />
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzadphdovv.htm" title="Find out how you code your applications to use the DB2 CLI functions.">Write a DB2 UDB CLI application</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|