518 lines
32 KiB
HTML
518 lines
32 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="reference" />
|
||
|
<meta name="DC.Title" content="Parameter passing conventions for stored procedures and UDFs" />
|
||
|
<meta name="abstract" content="The CALL statement and a function call can pass arguments to programs written in all supported host languages and REXX procedures." />
|
||
|
<meta name="description" content="The CALL statement and a function call can pass arguments to programs written in all supported host languages and REXX procedures." />
|
||
|
<meta name="DC.subject" content="stored procedures, parameter passing" />
|
||
|
<meta name="keywords" content="stored procedures, parameter passing" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafysproeg.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzajp/rzajpkickoff.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzaha/jsqlrout.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="rbafyppcsp" />
|
||
|
<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>Parameter passing conventions for stored procedures and UDFs</title>
|
||
|
</head>
|
||
|
<body id="rbafyppcsp"><a name="rbafyppcsp"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Parameter passing conventions for stored procedures and UDFs</h1>
|
||
|
<div><p>The CALL statement and a function call can pass arguments to programs
|
||
|
written in all supported host languages and REXX procedures.</p>
|
||
|
<div class="section"><p>Each language supports different data types that
|
||
|
are tailored to it, as shown in the following tables. The SQL data type is
|
||
|
contained in the leftmost column of the following table. Other columns in
|
||
|
that row contain an indication of whether that data type is supported as a
|
||
|
parameter type for a particular language. If the column is blank, the data
|
||
|
type is not supported as a parameter type for that language. A host variable
|
||
|
declaration indicates that DB2<sup>®</sup> SQL for <span class="keyword">iSeries™</span> supports
|
||
|
this data type as a parameter in this language. The declaration indicates
|
||
|
how host variables must be declared to be received and set properly by the
|
||
|
procedure or function. When calling an SQL procedure or function, all SQL
|
||
|
data types are supported so no column is provided in the table.</p>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><a name="rbafyppcsp__callpa1"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rbafyppcsp__callpa1" width="100%" frame="border" border="1" rules="all"><caption>Table 1. Data
|
||
|
types of parameters</caption><thead align="left"><tr><th align="left" valign="bottom" width="25%" id="d0e44">SQL data type</th>
|
||
|
<th align="left" valign="bottom" width="25%" id="d0e46">C and C++</th>
|
||
|
<th align="left" valign="bottom" width="25%" id="d0e48">CL</th>
|
||
|
<th align="left" valign="bottom" width="25%" id="d0e50">COBOL for <span class="keyword">iSeries</span> and
|
||
|
ILE COBOL for <span class="keyword">iSeries</span></th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e44 ">SMALLINT</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">short</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC S9(4) BINARY</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">INTEGER</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">long</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC S9(9) BINARY</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">BIGINT</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">long long</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC S9(18) BINAR <p><strong>Note:</strong> Only supported
|
||
|
for ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">DECIMAL(p,s)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">decimal(p,s)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">TYPE(*DEC) LEN(p s)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC S9(p-s)V9(s) PACKED-DECIMAL<p><strong>Note:</strong> Precision
|
||
|
must not be greater than 18.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">NUMERIC(p,s)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC S9(p-s)V9(s) DISPLAY SIGN LEADING SEPARATE <p><strong>Note:</strong> Precision
|
||
|
must not be greater than 18.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">REAL or FLOAT(p)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">float</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">COMP-1 <p><strong>Note:</strong> Only supported for
|
||
|
ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">DOUBLE PRECISION or FLOAT or FLOAT(p)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">double</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">COMP-2 <p><strong>Note:</strong> Only supported for
|
||
|
ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">CHARACTER(n)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">char ... [n+1]</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">TYPE(*CHAR) LEN(n)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC X(n)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">VARCHAR(n)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">char ... [n+1]</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">Varying-Length Character String </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">VARCHAR(n) FOR BIT DATA</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">VARCHAR structured form </td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">Varying-Length Character String </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">CLOB</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">CLOB structured form </td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">CLOB structured form <p><strong>Note:</strong> only supported
|
||
|
for ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">GRAPHIC(n)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">wchar_t ... [n+1]</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">PIC G(n) DISPLAY-1 or PIC N(n) <p><strong>Note:</strong> Only
|
||
|
supported for ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">VARGRAPHIC(n)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">VARGRAPHIC structured form </td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">Varying-Length Graphic String <p><strong>Note:</strong> Only
|
||
|
supported for ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">DBCLOB</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">DBCLOB structured form </td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">DBCLOB structured form <p><strong>Note:</strong> only supported
|
||
|
for ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">BINARY</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">BINARY structured form </td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">BINARY structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">VARBINARY</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">VARBINARY structured form </td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">VARBINARY structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">BLOB</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">BLOB structured form </td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">BLOB structured form <p><strong>Note:</strong> only supported
|
||
|
for ILE COBOL for <span class="keyword">iSeries</span>.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">DATE</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">char ... [11]</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">TYPE(*CHAR) LEN(10)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 "> PIC X(10) <p><strong>Note:</strong> for ILE COBOL
|
||
|
for <span class="keyword">iSeries</span> only, FORMAT DATE.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">TIME</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">char ... [9]</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">TYPE(*CHAR) LEN(8)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 "> PIC X(8) <p><strong>Note:</strong> for ILE COBOL for <span class="keyword">iSeries</span> only, FORMAT TIME.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">TIMESTAMP</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">char ... [27]</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">TYPE(*CHAR) LEN(26)</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 "> PIC X(26) <p><strong>Note:</strong> for ILE COBOL
|
||
|
for <span class="keyword">iSeries</span> only, FORMAT TIMESTAMP.</p>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">ROWID</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">ROWID structured form </td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">ROWID structured form </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e44 ">DataLink</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e46 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e50 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e44 ">Indicator Variable</td>
|
||
|
<td valign="top" width="25%" headers="d0e46 ">short</td>
|
||
|
<td valign="top" width="25%" headers="d0e48 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e50 ">PIC S9(4) BINARY</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><a name="rbafyppcsp__callpa2"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rbafyppcsp__callpa2" width="100%" frame="border" border="1" rules="all"><caption>Table 2. Data
|
||
|
types of parameters</caption><thead align="left"><tr><th align="left" valign="bottom" width="25%" id="d0e373">SQL data type</th>
|
||
|
<th valign="top" width="25%" id="d0e375">Java™ parameter style JAVA</th>
|
||
|
<th valign="top" width="25%" id="d0e379">Java parameter style DB2GENERAL</th>
|
||
|
<th align="left" valign="bottom" width="25%" id="d0e383">PL/I</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e373 ">SMALLINT</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">short</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">short</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">FIXED BIN(15)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">INTEGER</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">int</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">int</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">FIXED BIN(31)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">BIGINT</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">long</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">long</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">DECIMAL(p,s)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">BigDecimal</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">BigDecimal</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">FIXED DEC(p,s)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">NUMERIC(p,s)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">BigDecimal</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">BigDecimal</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">REAL or FLOAT(p)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">float</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">float</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">FLOAT BIN(p)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">DOUBLE PRECISION or FLOAT or FLOAT(p)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">double</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">double</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">FLOAT BIN(p)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">CHARACTER(n)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">String</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">CHAR(n)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">VARCHAR(n)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">String</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">CHAR(n) VAR</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">VARCHAR(n) FOR BIT DATA</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">byte[ ]</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Blob</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">CHAR(n) VAR</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">CLOB</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">java.sql.Clob</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Clob</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">CLOB structured form </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">GRAPHIC(n)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">String</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">VARGRAPHIC(n)</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">String</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">DBCLOB</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">java.sql.Clob</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Clob</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">DBCLOB structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">BINARY</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">byte[ ]</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Blob</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">BINARY structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">VARBINARY</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">byte[ ]</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Blob</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">VARBINARY structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">BLOB</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">java.sql.Blob</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Blob</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">BLOB structured form </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">DATE</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">Date</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">CHAR(10)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">TIME</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">Time</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">CHAR(8)</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">TIMESTAMP</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">Timestamp</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">String</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">CHAR(26)</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">ROWID</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">byte[]</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">com.ibm.db2.app.Blob</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">ROWID structured form</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="25%" headers="d0e373 ">DataLink</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">N/A</td>
|
||
|
<td align="left" valign="top" width="25%" headers="d0e383 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="25%" headers="d0e373 ">Indicator Variable</td>
|
||
|
<td valign="top" width="25%" headers="d0e375 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e379 ">N/A</td>
|
||
|
<td valign="top" width="25%" headers="d0e383 ">FIXED BIN(15)</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><a name="rbafyppcsp__callpa3"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rbafyppcsp__callpa3" width="100%" frame="border" border="1" rules="all"><caption>Table 3. Data types of parameters</caption><thead align="left"><tr><th align="left" valign="bottom" width="20%" id="d0e603">SQL data type </th>
|
||
|
<th valign="top" width="20%" id="d0e605">REXX</th>
|
||
|
<th align="left" valign="bottom" width="30.074074074074076%" id="d0e607">RPG</th>
|
||
|
<th align="left" valign="bottom" width="29.925925925925927%" id="d0e609">ILE RPG</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" width="20%" headers="d0e603 ">SMALLINT</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure that contains
|
||
|
a single sub-field. <strong><em>B</em></strong> in position 43, length must be 2, and
|
||
|
0 in position 52 of the sub-field specification.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>B</em></strong> in position
|
||
|
40, length must be <= 4, and 00 in positions 41-42 of the sub-field specification. <p>or</p>
|
||
|
Data
|
||
|
specification. <strong><em>I</em></strong> in position 40, length must be 5, and 00 in
|
||
|
positions 41-42 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">INTEGER</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">numeric string with no decimal (and an optional
|
||
|
leading sign)</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure that contains
|
||
|
a single sub-field. <strong><em>B</em></strong> in position 43, length must be 4, and
|
||
|
0 in position 52 of the sub-field specification.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>B</em></strong> in position
|
||
|
40, length must be <=09 and >=05, and 00 in positions 41-42 of the sub-field
|
||
|
specification. <p>or</p>
|
||
|
Data specification. <strong><em>I</em></strong> in position
|
||
|
40, length must be 10, and 00 in positions 41-42 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">BIGINT</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>I</em></strong> in position
|
||
|
40, length must be 20, and 00 in positions 41-42 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">DECIMAL(p,s)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">numeric string with a decimal (and an optional leading
|
||
|
sign)</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure that contains
|
||
|
a single sub-field. <strong><em>P</em></strong> in position 43 and 0 through 9 in position
|
||
|
52 of the sub-field specification. or A numeric input field or calculation
|
||
|
result field.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>P</em></strong> in position
|
||
|
40 and 00 through 31 in positions 41-42 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">NUMERIC(p,s)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure that contains
|
||
|
a single sub-field. <strong><em>Blank</em></strong> in position 43 and 0 through 9 in
|
||
|
position 52 of the sub-field specification.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>S</em></strong> in position
|
||
|
40, or <strong><em>Blank</em></strong> in position 40 and 00 through 31 in position 41-42
|
||
|
of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">REAL or FLOAT(p)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with digits, then an E, (then an optional
|
||
|
sign), then digits</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>F</em></strong> in position
|
||
|
40, length must be 4.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">DOUBLE PRECISION or FLOAT
|
||
|
or FLOAT(p)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with digits, then an E, (then an optional
|
||
|
sign), then digits</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>F</em></strong> in position
|
||
|
40, length must be 8.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">CHARACTER(n)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with n characters within two apostrophes</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure field without
|
||
|
sub-fields or data structure that contains a single sub-field. <strong><em>Blank</em></strong> in
|
||
|
position 43 and 52 of the sub-field specification. or A character input field
|
||
|
or calculation result field.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>A</em></strong> in position
|
||
|
40, or <strong><em>Blank</em></strong> in position 40 and 41-42 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">VARCHAR(n)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with n characters within two apostrophes</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">N/A </td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>A</em></strong> in position
|
||
|
40, or <strong><em>Blank</em></strong> in position 40 and 41-42 of the sub-field specification
|
||
|
and the keyword VARYING in positions 44-80.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">VARCHAR(n) FOR BIT DATA</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with n characters within two apostrophes</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 "> N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>A</em></strong> in position
|
||
|
40, or <strong><em>Blank</em></strong> in position 40 and 41-42 of the sub-field specification
|
||
|
and the keyword VARYING in positions 44-80.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">CLOB</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">CLOB structured form </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">GRAPHIC(n)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string starting with G', then n double byte characters,
|
||
|
then '</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>G</em></strong> in position
|
||
|
40 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">VARGRAPHIC(n)</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string starting with G', then n double byte characters,
|
||
|
then '</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 "> N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>G</em></strong> in position
|
||
|
40 of the sub-field specification and the keyword VARYING in positions 44-80.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">DBCLOB</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">DBCLOB structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">BINARY</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">BINARY structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">VARBINARY</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">VARBINARY structured form </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">BLOB</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">BLOB structured form </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">DATE</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with 10 characters within two apostrophes</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure field without
|
||
|
sub-fields or data structure that contains a single sub-field. <strong><em>Blank</em></strong> in
|
||
|
position 43 and 52 of the sub-field specification. Length is 10. or A character
|
||
|
input field or calculation result field.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>D</em></strong> in position
|
||
|
40 of the sub-field specification. DATFMT(*ISO) in position 44-80.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">TIME</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with 8 characters within two apostrophes</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure field without
|
||
|
sub-fields or data structure that contains a single sub-field. <strong><em>Blank</em></strong> in
|
||
|
position 43 and 52 of the sub-field specification. Length is 8. or A character
|
||
|
input field or calculation result field.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>T</em></strong> in position
|
||
|
40 of the sub-field specification. TIMFMT(*ISO) in position 44-80.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">TIMESTAMP</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">string with 26 characters within two apostrophes</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure field without
|
||
|
sub-fields or data structure that contains a single sub-field. <strong><em>Blank</em></strong> in
|
||
|
position 43 and 52 of the sub-field specification. Length is 26. or A character
|
||
|
input field or calculation result field.</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>Z</em></strong> in position
|
||
|
40 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">ROWID</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">ROWID structured form </td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="20%" headers="d0e603 ">DataLink</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">N/A</td>
|
||
|
<td align="left" valign="top" width="30.074074074074076%" headers="d0e607 ">N/A</td>
|
||
|
<td align="left" valign="top" width="29.925925925925927%" headers="d0e609 ">N/A</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="20%" headers="d0e603 ">Indicator Variable</td>
|
||
|
<td valign="top" width="20%" headers="d0e605 ">numeric string with no decimal (and an optional
|
||
|
leading sign).</td>
|
||
|
<td valign="top" width="30.074074074074076%" headers="d0e607 ">Data structure that contains a single sub-field. <strong><em>B</em></strong> in
|
||
|
position 43, length must be 2, and 0 in position 52 of the sub-field specification.</td>
|
||
|
<td valign="top" width="29.925925925925927%" headers="d0e609 ">Data specification. <strong><em>B</em></strong> in position 40,
|
||
|
length must be <=4, and 00 in positions 41-42 of the sub-field specification.</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafysproeg.htm" title="A procedure (often called a stored procedure) is a program that can be called to perform operations that can include both host language statements and SQL statements. Procedures in SQL provide the same benefits as procedures in a host language.">Stored procedures</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../rzajp/rzajpkickoff.htm">Embedded SQL programming</a></div>
|
||
|
<div><a href="../rzaha/jsqlrout.htm">Java SQL routines</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|