ibm-information-center/dist/eclipse/plugins/i5OS.ic.cli_5.4.0.1/rzadpdataconversion.htm

57 lines
3.8 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="Data conversion in DB2 UDB CLI functions" />
<meta name="DC.subject" content="data conversion, description" />
<meta name="keywords" content="data conversion, description" />
<meta name="DC.Relation" scheme="URI" content="rzadphddtdcn.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="rzadpdataconversion" />
<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>Data conversion in DB2 UDB CLI functions</title>
</head>
<body id="rzadpdataconversion"><a name="rzadpdataconversion"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Data conversion in DB2 UDB CLI functions</h1>
<div><p>As mentioned previously, DB2 UDB CLI manages the transfer and any required
conversion of data between the application and the Database Management System
(DBMS). Before the data transfer actually takes place, the source, target
or both data types are indicated when calling <samp class="codeph">SQLBindParam()</samp>, <samp class="codeph">SQLBindParameter()</samp>, <samp class="codeph">SQLSetParam()</samp>, <samp class="codeph">SQLBindCol()</samp> or <samp class="codeph">SQLGetData()</samp>. These functions
use the symbolic type names shown in <a href="rzadphddtdcn.htm#rzadphddtdcn__tbcsql">Table 1</a>,
to identify the data types involved. Refer to the <a href="rzadpfnfetch.htm">SQLFetch - Fetch next row</a>,
or <a href="rzadpfngcol.htm">SQLGetCol - Retrieve one column of a row of the result set</a> for examples of the functions that
use the symbolic data types.</p>
<p>For a list of supported data type conversions in DB2 UDB
CLI, see the data type compatibility table in the <a href="../db2/rbafzmst.htm"> Assignments and comparisons</a> topic. Other
conversions can be achieved by using SQL scalar functions or the SQL CAST
function in the SQL syntax of the statement being processed.</p>
<p>The functions mentioned in the previous paragraph can be
used to convert data to other types. Not all data conversions are supported
or make sense. </p>
<p>Whenever truncation that is rounding or data type incompatibilities occur
on a function call, either SQL_ERROR or SQL_SUCCESS_WITH_INFO is returned.
Further information is then indicated by the SQLSTATE value and other information
returned by <samp class="codeph">SQLError()</samp>.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzadphddtdcn.htm" title="This topics shows all of the supported SQL types and their corresponding symbolic names.">Data types and data conversion in DB2 UDB CLI functions</a></div>
</div>
</div>
</body>
</html>