176 lines
9.5 KiB
HTML
176 lines
9.5 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="Special registers in SQL statements" />
|
||
|
<meta name="abstract" content="You can specify certain special registers in SQL statements." />
|
||
|
<meta name="description" content="You can specify certain special registers in SQL statements." />
|
||
|
<meta name="DC.subject" content="SELECT statement, special register, example, CURRENT DATE, CURRENT TIME, CURRENT TIMESTAMP, CURRENT TIMEZONE, CURRENT SERVER, CURRENT SCHEMA, USER, CURRENT DATE special register, CURRENT TIME special register, CURRENT TIMESTAMP special register, CURRENT TIMEZONE special register, CURRENT SERVER special register, CURRENT SCHEMA special register, USER special register" />
|
||
|
<meta name="keywords" content="SELECT statement, special register, example, CURRENT DATE, CURRENT TIME, CURRENT TIMESTAMP, CURRENT TIMEZONE, CURRENT SERVER, CURRENT SCHEMA, USER, CURRENT DATE special register, CURRENT TIME special register, CURRENT TIMESTAMP special register, CURRENT TIMEZONE special register, CURRENT SERVER special register, CURRENT SCHEMA special register, USER special register" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafytexas.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="rbafyspecreg" />
|
||
|
<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>Special registers in SQL statements</title>
|
||
|
</head>
|
||
|
<body id="rbafyspecreg"><a name="rbafyspecreg"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Special registers in SQL statements</h1>
|
||
|
<div><p>You can specify certain special registers in SQL statements. </p>
|
||
|
<div class="section"><p>For <em>locally</em> run SQL statements, the special registers and
|
||
|
their contents are shown in the following table:</p>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><thead align="left"><tr><th align="left" valign="bottom" id="d0e61">Special registers</th>
|
||
|
<th align="left" valign="bottom" id="d0e63">Contents</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" headers="d0e61 "> <p>CURRENT DATE<br />
|
||
|
CURRENT_DATE</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e63 ">The current date.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e61 "><img src="./delta.gif" alt="Start of change" /><p>CURRENT DEGREE</p><img src="./deltaend.gif" alt="End of change" />
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e63 "><img src="./delta.gif" alt="Start of change" />The number of tasks the data base manager
|
||
|
should run in parallel.<img src="./deltaend.gif" alt="End of change" /></td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e61 "> <p>CURRENT PATH<br />
|
||
|
CURRENT_PATH<br />
|
||
|
CURRENT FUNCTION PATH</p>
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e63 ">The SQL path used to resolve unqualified data type names,
|
||
|
procedure names, and function names in dynamically prepared SQL statements.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e61 "> <p>CURRENT SCHEMA</p>
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e63 ">The schema name used to qualify unqualified database
|
||
|
object references where applicable in dynamically prepared SQL statements.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e61 "> <p>CURRENT SERVER<br />
|
||
|
CURRENT_SERVER</p>
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e63 ">The name of the relational database currently being
|
||
|
used.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e61 "> <p>CURRENT TIME<br />
|
||
|
CURRENT_TIME</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e63 ">The current time.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e61 "> <p>CURRENT TIMESTAMP<br />
|
||
|
CURRENT_TIMESTAMP</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e63 ">The current date and time in timestamp format.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e61 "> <p>CURRENT TIMEZONE<br />
|
||
|
CURRENT_TIMEZONE</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e63 ">A duration of time that links local time
|
||
|
to Universal Time Coordinated (UTC) using the formula: <pre>local time -
|
||
|
CURRENT TIMEZONE = UTC</pre>
|
||
|
It is taken from the system value QUTCOFFSET.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e61 "><img src="./delta.gif" alt="Start of change" /><p>SESSION_USER<br />
|
||
|
USER</p><img src="./deltaend.gif" alt="End of change" />
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e63 "><img src="./delta.gif" alt="Start of change" />The runtime authorization identifier
|
||
|
(user profile) of the job.<img src="./deltaend.gif" alt="End of change" /></td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e61 "><img src="./delta.gif" alt="Start of change" /><p>SYSTEM_USER</p><img src="./deltaend.gif" alt="End of change" />
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e63 "><img src="./delta.gif" alt="Start of change" />The authorization identifier (user
|
||
|
profile) of the user connected to the database.<img src="./deltaend.gif" alt="End of change" /></td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="section"><p>If a single statement contains more than one reference to any
|
||
|
of CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP special registers, or
|
||
|
the CURDATE, CURTIME, or NOW scalar functions, all values are based on a single
|
||
|
clock reading.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>For <em>remotely</em> run SQL statements, the special registers
|
||
|
and their contents are shown in the following table:</p>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><thead align="left"><tr><th align="left" valign="bottom" id="d0e151">Special registers</th>
|
||
|
<th align="left" valign="bottom" id="d0e153">Contents</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" headers="d0e151 "> <p>CURRENT DATE<br />
|
||
|
CURRENT_DATE<br />
|
||
|
CURRENT TIME<br />
|
||
|
CURRENT_TIME<br />
|
||
|
CURRENT TIMESTAMP<br />
|
||
|
CURRENT_TIMESTAMP</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e153 ">The current date and time at the remote system,
|
||
|
not the local system.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e151 "><img src="./delta.gif" alt="Start of change" /><p>CURRENT DEGREE</p><img src="./deltaend.gif" alt="End of change" />
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e153 "><img src="./delta.gif" alt="Start of change" />The number of tasks the data base manager
|
||
|
should run in parallel on the remote system. <img src="./deltaend.gif" alt="End of change" /></td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e151 "> <p>CURRENT TIMEZONE<br />
|
||
|
CURRENT_TIMEZONE</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e153 ">A duration of time that links the remote
|
||
|
system time to UTC.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e151 "> <p>CURRENT SERVER<br />
|
||
|
CURRENT_SERVER</p>
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e153 ">The name of the relational database currently
|
||
|
being used.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e151 ">CURRENT SCHEMA</td>
|
||
|
<td valign="top" headers="d0e153 ">The current schema value at the remote system.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e151 "> <p>CURRENT PATH<br />
|
||
|
CURRENT_PATH<br />
|
||
|
CURRENT FUNCTION PATH</p>
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e153 ">The current path value at the remote system.</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e151 "> <img src="./delta.gif" alt="Start of change" /><p>SESSION_USER<br />
|
||
|
USER</p><img src="./deltaend.gif" alt="End of change" />
|
||
|
</td>
|
||
|
<td align="left" valign="top" headers="d0e153 ">The runtime authorization identifier (user
|
||
|
profile) of the job on the remote system.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e151 "><img src="./delta.gif" alt="Start of change" /><p>SYSTEM_USER</p><img src="./deltaend.gif" alt="End of change" />
|
||
|
</td>
|
||
|
<td valign="top" headers="d0e153 ">The authorization identifier (user profile) of the user
|
||
|
connected to the database on the remote system.</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="section"><p>When a query over a distributed table references a special register,
|
||
|
the contents of the special register on the system that requests the query
|
||
|
are used. For more information about distributed tables, see <a href="../dbmult/rzaf3kickoff.htm">DB2<sup>®</sup> Multisystem</a> topic collection.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafytexas.htm" title="Learn a variety of ways of tailoring your query to gather data using the SELECT statement. One way to do this is to use the SELECT statement in a program to retrieve a specific row (for example, the row for an employee). Furthermore, you can use clauses to gather data in a specific way.">Retrieve data using the SELECT statement</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|