78 lines
5.4 KiB
HTML
78 lines
5.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="reference" />
|
||
|
<meta name="DC.Title" content="Rules for date, time, and timestamp assignment of host variables in SQL statements" />
|
||
|
<meta name="abstract" content="When a date is assigned to a host variable, the date is converted to the string representation specified by the DATFMT and DATSEP parameters of the CRTSQLxxx command." />
|
||
|
<meta name="description" content="When a date is assigned to a host variable, the date is converted to the string representation specified by the DATFMT and DATSEP parameters of the CRTSQLxxx command." />
|
||
|
<meta name="DC.subject" content="date assignment rule, host variable, using, time assignment rule, timestamp assignment rule, rule, assignment rule, host variable, SQL statement, use in, rule for date, time, and timestamp assignment, assignment rule, date, time, timestamp" />
|
||
|
<meta name="keywords" content="date assignment rule, host variable, using, time assignment rule, timestamp assignment rule, rule, assignment rule, host variable, SQL statement, use in, rule for date, time, and timestamp assignment, assignment rule, date, time, timestamp" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpasnrule.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="rzajpdaterule" />
|
||
|
<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>Rules for date, time, and timestamp assignment of host variables in
|
||
|
SQL statements</title>
|
||
|
</head>
|
||
|
<body id="rzajpdaterule"><a name="rzajpdaterule"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Rules for date, time, and timestamp assignment of host variables in
|
||
|
SQL statements</h1>
|
||
|
<div><p>When a <strong>date</strong> is assigned to a host variable, the date is
|
||
|
converted to the string representation specified by the DATFMT and DATSEP
|
||
|
parameters of the CRTSQLxxx command.</p>
|
||
|
<div class="section"><p> Leading zeros are not omitted from any part of the date representation.
|
||
|
The host variable must be a fixed or variable-length character string variable
|
||
|
with a length of at least 10 bytes for *USA, *EUR, *JIS, or *ISO date formats,
|
||
|
8 bytes for *MDY, *DMY, or *YMD date formats, or 6 bytes for the *JUL date
|
||
|
format. If the length is greater than 10, the string is padded on the right
|
||
|
with blanks. In ILE RPG and ILE COBOL, the host variable can also be a date
|
||
|
variable.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>When a <strong>time</strong> is assigned to a host variable, the time is
|
||
|
converted to the string representation by the TIMFMT and TIMSEP parameters
|
||
|
of the CRTSQLxxx command. Leading zeros are not omitted. The host variable
|
||
|
must be a fixed or variable-length character string variable. If the length
|
||
|
of the host variable is greater than the string representation of the time,
|
||
|
the string is padded on the right with blanks. In ILE RPG and ILE COBOL, the
|
||
|
host variable can also be a time variable. </p>
|
||
|
<ul><li>If the *USA format is used, the length of the host variable must not be
|
||
|
less than 8.</li>
|
||
|
<li>If the *HMS, *ISO, *EUR, or *JIS format is used, the length of the host
|
||
|
variable must be at least 8 bytes if seconds are to be included, and 5 bytes
|
||
|
if only hours and minutes are needed. In this case, SQLWARN0 and SQLWARN1
|
||
|
(in the SQLCA) are set to W, and if an indicator variable is specified, it
|
||
|
is set to the actual number of seconds truncated.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section"><p>When a <strong>timestamp</strong> is assigned to a host variable, the timestamp
|
||
|
is converted to its string representation. Leading zeros are not omitted from
|
||
|
any part. The host variable must be a fixed or variable-length character string
|
||
|
variable with a length of at least 19 bytes. If the length is less than 26,
|
||
|
the host variable does not include all the digits of the microseconds. If
|
||
|
the length is greater than 26, the host variable is padded on the right with
|
||
|
blanks. In ILE RPG and ILE COBOL, the host variable can also be a timestamp
|
||
|
variable.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajpasnrule.htm" title="SQL values are assigned to host variables during the running of FETCH, SELECT INTO, SET, and VALUES INTO statements. SQL values are assigned from host variables during the running of INSERT, UPDATE, and CALL statements.">Assignment rules for host variables in SQL statements</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|