ibm-information-center/dist/eclipse/plugins/i5OS.ic.db2_5.4.0.1/rbafzmstch2func.htm

953 lines
36 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="dc.language" scheme="rfc1766" 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. -->
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<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))' />
<title>Built-in functions</title>
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
<link rel="stylesheet" type="text/css" href="ic.css" />
</head>
<body>
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
<a name="ch2func"></a>
<h1 id="ch2func"><a href="rbafzmst02.htm#ToC_315">Built-in functions</a></h1>
<p>This chapter contains syntax diagrams, semantic descriptions,
rules, and examples of the use of the <span class="italic">built-in functions</span> listed in the following tables. For more information on functions, see <a href="rbafzmstch2function.htm#ch2function">Functions</a>.</p>
<a name="wq451"></a>
<table id="wq451" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 28. Aggregate Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq452" width="29%" align="left" valign="bottom">Function</th>
<th id="wq453" width="52%" align="left" valign="bottom">Description</th>
<th id="wq454" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq452">AVG</td>
<td headers="wq453">Returns the average of a set of numbers</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#avg">AVG</a></td>
</tr>
<tr>
<td headers="wq452">COUNT</td>
<td headers="wq453">Returns the number of rows or values in a set of rows
or values</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#count">COUNT</a></td>
</tr>
<tr>
<td headers="wq452">COUNT_BIG</td>
<td headers="wq453">Returns the number of rows or values in a set of rows
or values (COUNT_BIG is similar to COUNT except that the result can be greater
than the maximum value of integer)</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#countbig">COUNT_BIG</a></td>
</tr>
<tr>
<td headers="wq452">MAX</td>
<td headers="wq453">Returns the maximum value in a set of values in a group</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colmax">MAX</a></td>
</tr>
<tr>
<td headers="wq452">MIN</td>
<td headers="wq453">Returns the minimum value in a set of values in a group</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colmin">MIN</a></td>
</tr>
<tr>
<td headers="wq452">STDDEV</td>
<td headers="wq453">Returns the biased standard deviation of a set of numbers</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colstddev">STDDEV_POP or STDDEV</a></td>
</tr>
<tr>
<td headers="wq452">STDDEV_SAMP</td>
<td headers="wq453">Returns the sample standard deviation of a set of numbers</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colstddevsamp">STDDEV_SAMP</a></td>
</tr>
<tr>
<td headers="wq452">SUM</td>
<td headers="wq453">Returns the sum of a set of numbers</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colsum">SUM</a></td>
</tr>
<tr>
<td headers="wq452">VARIANCE or VAR</td>
<td headers="wq453">Returns the biased variance of a set of numbers</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colvar">VAR_POP or VARIANCE or VAR</a></td>
</tr>
<tr>
<td headers="wq452">VARIANCE_SAMP or VAR_SAMP</td>
<td headers="wq453">Returns the sample variance of a set of numbers</td>
<td headers="wq454"><a href="rbafzmstcolfunc.htm#colvarsamp">VARIANCE_SAMP or VAR_SAMP</a></td>
</tr>
</tbody>
</table>
<a name="wq455"></a>
<table id="wq455" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 29. Cast Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq456" width="29%" align="left" valign="bottom">Function</th>
<th id="wq457" width="52%" align="left" valign="bottom">Description</th>
<th id="wq458" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq456">BIGINT</td>
<td headers="wq457">Returns a big integer representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#bigfunc">BIGINT</a></td>
</tr>
<tr>
<td headers="wq456">BINARY</td>
<td headers="wq457">Returns a BINARY representation of a string of any type</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scabinary">BINARY</a></td>
</tr>
<tr>
<td headers="wq456">BLOB</td>
<td headers="wq457">Returns a BLOB representation of a string of any type</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scablob">BLOB</a></td>
</tr>
<tr>
<td headers="wq456">CHAR</td>
<td headers="wq457">Returns a CHARACTER representation of a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scachar">CHAR</a></td>
</tr>
<tr>
<td headers="wq456">CLOB</td>
<td headers="wq457">Returns a CLOB representation of a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scaclob">CLOB</a></td>
</tr>
<tr>
<td headers="wq456">DATE</td>
<td headers="wq457">Returns a DATE from a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scadate">DATE</a></td>
</tr>
<tr>
<td headers="wq456">DBCLOB</td>
<td headers="wq457">Returns a DBCLOB representation of a string</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scadbclob">DBCLOB</a></td>
</tr>
<tr>
<td headers="wq456">DECIMAL</td>
<td headers="wq457">Returns a DECIMAL representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scadec">DECIMAL or DEC</a></td>
</tr>
<tr>
<td headers="wq456">DOUBLE_PRECISION or DOUBLE</td>
<td headers="wq457">Returns a DOUBLE PRECISION representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#dblprc">DOUBLE_PRECISION or DOUBLE</a></td>
</tr>
<tr>
<td headers="wq456">FLOAT</td>
<td headers="wq457">Returns a FLOAT representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#fltfunc">FLOAT</a></td>
</tr>
<tr>
<td headers="wq456">GRAPHIC</td>
<td headers="wq457">Returns a GRAPHIC representation of a string</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scagraphic">GRAPHIC</a></td>
</tr>
<tr>
<td headers="wq456">INTEGER or INT</td>
<td headers="wq457">Returns an INTEGER representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#intfunc">INTEGER or INT</a></td>
</tr>
<tr>
<td headers="wq456">REAL</td>
<td headers="wq457">Returns a REAL representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#realfun">REAL</a></td>
</tr>
<tr>
<td headers="wq456">ROWID</td>
<td headers="wq457">Returns a Row ID from a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scarowid">ROWID</a></td>
</tr>
<tr>
<td headers="wq456">SMALLINT</td>
<td headers="wq457">Returns a SMALLINT representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#smifunc">SMALLINT</a></td>
</tr>
<tr>
<td headers="wq456">TIME</td>
<td headers="wq457">Returns a TIME from a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scatime">TIME</a></td>
</tr>
<tr>
<td headers="wq456">TIMESTAMP</td>
<td headers="wq457">Returns a TIMESTAMP from a value or a pair of values</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scatimestamp">TIMESTAMP</a></td>
</tr>
<tr>
<td headers="wq456">TIMESTAMP_ISO</td>
<td headers="wq457">Returns a timestamp value from a datetime value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scaisotmsp">TIMESTAMP_ISO</a></td>
</tr>
<tr>
<td headers="wq456">VARBINARY</td>
<td headers="wq457">Returns a VARBINARY representation of a string of any
type</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scavarbinary">VARBINARY</a></td>
</tr>
<tr>
<td headers="wq456">VARCHAR</td>
<td headers="wq457">Returns a VARCHAR representative of a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scavarchar">VARCHAR</a></td>
</tr>
<tr>
<td headers="wq456">VARGRAPHIC</td>
<td headers="wq457">Returns a VARGRAPHIC representation of a value</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scavargraph">VARGRAPHIC</a></td>
</tr>
<tr>
<td headers="wq456">ZONED</td>
<td headers="wq457">Returns a zoned decimal representation of a number</td>
<td headers="wq458"><a href="rbafzmstscale.htm#scazoned">ZONED</a></td>
</tr>
</tbody>
</table>
<a name="wq459"></a>
<table id="wq459" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 30. Datalink Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq460" width="29%" align="left" valign="bottom">Function</th>
<th id="wq461" width="51%" align="left" valign="bottom">Description</th>
<th id="wq462" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq460">DLCOMMENT</td>
<td headers="wq461">Returns the comment value from a DataLink value</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlcomment">DLCOMMENT</a></td>
</tr>
<tr>
<td headers="wq460">DLLINKTYPE</td>
<td headers="wq461">Returns the link type value from a DataLink value</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadllktype">DLLINKTYPE</a></td>
</tr>
<tr>
<td headers="wq460">DLURLCOMPLETE</td>
<td headers="wq461">Returns the complete URL value from a DataLink value
with a link type of URL</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlurlcomp">DLURLCOMPLETE</a></td>
</tr>
<tr>
<td headers="wq460">DLURLPATH</td>
<td headers="wq461">Returns the path and file name necessary to access a
file within a given server from a DataLink value with a linktype of URL</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlurlpath">DLURLPATH</a></td>
</tr>
<tr>
<td headers="wq460">DLURLPATHONLY</td>
<td headers="wq461">Returns the path and file name necessary to access a
file within a given server from a DataLink value with a linktype of URL without
a file access token</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlurlponly">DLURLPATHONLY</a></td>
</tr>
<tr>
<td headers="wq460">DLURLSCHEME</td>
<td headers="wq461">Returns the scheme from a DataLink value with a linktype
of URL</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlurlschem">DLURLSCHEME</a></td>
</tr>
<tr>
<td headers="wq460">DLURLSERVER</td>
<td headers="wq461">Returns the file server from a DataLink value with a
linktype of URL</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlserver">DLURLSERVER</a></td>
</tr>
<tr>
<td headers="wq460">DLVALUE</td>
<td headers="wq461">Returns a DataLink value</td>
<td headers="wq462"><a href="rbafzmstscale.htm#scadlvalue">DLVALUE</a></td>
</tr>
</tbody>
</table>
<a name="wq463"></a>
<table id="wq463" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 31. Datetime Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq464" width="29%" align="left" valign="bottom">Function</th>
<th id="wq465" width="51%" align="left" valign="bottom">Description</th>
<th id="wq466" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq464">ADD_MONTHS</td>
<td headers="wq465">Returns a date that represents the date argument plus
the number of months argument</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaaddmonths">ADD_MONTHS</a></td>
</tr>
<tr>
<td headers="wq464">CURDATE</td>
<td headers="wq465">Returns a date based on a reading of the time-of-day
clock</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scacurdate">CURDATE</a></td>
</tr>
<tr>
<td headers="wq464">CURTIME</td>
<td headers="wq465">Returns a time based on a reading of the time-of-day
clock</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scacurtime">CURTIME</a></td>
</tr>
<tr>
<td headers="wq464">DAY</td>
<td headers="wq465">Returns the day part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#dayfunc">DAY</a></td>
</tr>
<tr>
<td headers="wq464">DAYNAME</td>
<td headers="wq465">Returns the name of the day part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scadayname">DAYNAME</a></td>
</tr>
<tr>
<td headers="wq464">DAYOFMONTH</td>
<td headers="wq465">Returns an integer that represents the day of the month</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scadofmonth">DAYOFMONTH</a></td>
</tr>
<tr>
<td headers="wq464">DAYOFWEEK</td>
<td headers="wq465">Returns the day of the week from a value, where 1 is
Sunday and 7 is Saturday</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scadofweek">DAYOFWEEK</a></td>
</tr>
<tr>
<td headers="wq464">DAYOFWEEK_ISO</td>
<td headers="wq465">Returns the day of the week from a value, where 1 is
Monday and 7 is Sunday</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaisodweek">DAYOFWEEK_ISO</a></td>
</tr>
<tr>
<td headers="wq464">DAYOFYEAR</td>
<td headers="wq465">Returns the day of the year from a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scadofyear">DAYOFYEAR</a></td>
</tr>
<tr>
<td headers="wq464">DAYS</td>
<td headers="wq465">Returns an integer representation of a date</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scadays">DAYS</a></td>
</tr>
<tr>
<td headers="wq464">EXTRACT</td>
<td headers="wq465">Returns a datetime portion of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaextract">EXTRACT</a></td>
</tr>
<tr>
<td headers="wq464">HOUR</td>
<td headers="wq465">Returns the hour part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scahour">HOUR</a></td>
</tr>
<tr>
<td headers="wq464">JULIAN_DAY</td>
<td headers="wq465">Returns an integer value representing a number of days
from January 1, 4712 B.C. to the date specified in the argument</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scajulian">JULIAN_DAY</a></td>
</tr>
<tr>
<td headers="wq464">LAST_DAY</td>
<td headers="wq465">Returns a date that represents the last day of the month
of the date argument</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scalastday">LAST_DAY</a></td>
</tr>
<tr>
<td headers="wq464">MICROSECOND</td>
<td headers="wq465">Returns the microsecond part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scamicro">MICROSECOND</a></td>
</tr>
<tr>
<td headers="wq464">MIDNIGHT_SECONDS</td>
<td headers="wq465">Returns an integer value representing the number of
seconds between midnight and a specified time value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scamidnight">MIDNIGHT_SECONDS</a></td>
</tr>
<tr>
<td headers="wq464">MINUTE</td>
<td headers="wq465">Returns the minute part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaminute">MINUTE</a></td>
</tr>
<tr>
<td headers="wq464">MONTH</td>
<td headers="wq465">Returns the month part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scamonth">MONTH</a></td>
</tr>
<tr>
<td headers="wq464">MONTHNAME</td>
<td headers="wq465">Returns the name of the month part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scamname">MONTHNAME</a></td>
</tr>
<tr>
<td headers="wq464">NEXT_DAY</td>
<td headers="wq465">Returns a timestamp that represents the first weekday,
named by the second argument, after the date argument</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scanextday">NEXT_DAY</a></td>
</tr>
<tr>
<td headers="wq464">NOW</td>
<td headers="wq465">Returns a timestamp based on a reading of the time-of-day
clock</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scanow">NOW</a></td>
</tr>
<tr>
<td headers="wq464">QUARTER</td>
<td headers="wq465">Returns an integer that represents the quarter of the
year in which a date resides</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaquarter">QUARTER</a></td>
</tr>
<tr>
<td headers="wq464">SECOND</td>
<td headers="wq465">Returns the seconds part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scasec">SECOND</a></td>
</tr>
<tr>
<td headers="wq464">TIMESTAMPDIFF</td>
<td headers="wq465">Returns an estimated number of intervals based on the
difference between two timestamps</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scatimedifstmp">TIMESTAMPDIFF</a></td>
</tr>
<tr>
<td headers="wq464">VARCHAR_FORMAT</td>
<td headers="wq465">Returns a character string representation of a timestamp,
with the string in a specified format</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scavarcharformat">VARCHAR_FORMAT</a></td>
</tr>
<tr>
<td headers="wq464">WEEK</td>
<td headers="wq465">Returns the week of the year from a value, where the
week starts with Sunday</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaweek">WEEK</a></td>
</tr>
<tr>
<td headers="wq464">WEEK_ISO</td>
<td headers="wq465">Returns the week of the year from a value, where the
week starts with Monday</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scaisoweek">WEEK_ISO</a></td>
</tr>
<tr>
<td headers="wq464">YEAR</td>
<td headers="wq465">Returns the year part of a value</td>
<td headers="wq466"><a href="rbafzmstscale.htm#scayear">YEAR</a></td>
</tr>
</tbody>
</table>
<a name="wq467"></a>
<table id="wq467" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 32. Partitioning Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq468" width="29%" align="left" valign="bottom">Function</th>
<th id="wq469" width="51%" align="left" valign="bottom">Description</th>
<th id="wq470" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq468">DATAPARTITIONNAME</td>
<td headers="wq469">Returns the partition name where a row is located</td>
<td headers="wq470"><a href="rbafzmstscale.htm#scadataname">DATAPARTITIONNAME</a></td>
</tr>
<tr>
<td headers="wq468">DATAPARTITIONNUM</td>
<td headers="wq469">Returns the partition number of a row</td>
<td headers="wq470"><a href="rbafzmstscale.htm#scadatanumb">DATAPARTITIONNUM</a></td>
</tr>
<tr>
<td headers="wq468">DBPARTITIONNAME</td>
<td headers="wq469">Returns the relational database name where a row is
located</td>
<td headers="wq470"><a href="rbafzmstscale.htm#scanodename">DBPARTITIONNAME</a></td>
</tr>
<tr>
<td headers="wq468">DBPARTITIONNUM</td>
<td headers="wq469">Returns the node number of a row</td>
<td headers="wq470"><a href="rbafzmstscale.htm#scandnumb">DBPARTITIONNUM</a></td>
</tr>
<tr>
<td headers="wq468">HASH</td>
<td headers="wq469">Returns the partition number of a set of values</td>
<td headers="wq470"><a href="rbafzmstscale.htm#scahash">HASH</a></td>
</tr>
<tr>
<td headers="wq468">HASHED_VALUE</td>
<td headers="wq469">Returns the partition map index number of a row</td>
<td headers="wq470"><a href="rbafzmstscale.htm#scapartition">HASHED_VALUE</a></td>
</tr>
</tbody>
</table>
<a name="wq471"></a>
<table id="wq471" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 33. Miscellaneous Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq472" width="29%" align="left" valign="bottom">Function</th>
<th id="wq473" width="51%" align="left" valign="bottom">Description</th>
<th id="wq474" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq472">COALESCE</td>
<td headers="wq473">Returns the first argument that is not null</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scacoales">COALESCE</a></td>
</tr>
<tr>
<td headers="wq472">DATABASE</td>
<td headers="wq473">Returns the current server</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scadatabase">DATABASE</a></td>
</tr>
<tr>
<td headers="wq472">GENERATE_UNIQUE</td>
<td headers="wq473">Returns a bit character string that is unique compared
to any other execution of the function</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scagenerateunique">GENERATE_UNIQUE</a></td>
</tr>
<tr>
<td headers="wq472">HEX</td>
<td headers="wq473">Returns a hexadecimal representation of a value</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scahex">HEX</a></td>
</tr>
<tr>
<td headers="wq472">IDENTITY_VAL_LOCAL</td>
<td headers="wq473">Returns the most recently assigned value for an identity
column</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scaidentity">IDENTITY_VAL_LOCAL</a></td>
</tr>
<tr>
<td headers="wq472">IFNULL</td>
<td headers="wq473">Returns the first argument that is not null</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scaifnull">IFNULL</a></td>
</tr>
<tr>
<td headers="wq472">LENGTH</td>
<td headers="wq473">Returns the length of a value</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scalength">LENGTH</a></td>
</tr>
<tr>
<td headers="wq472">MAX</td>
<td headers="wq473">Returns the maximum value in a set of values</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scamax">MAX</a></td>
</tr>
<tr>
<td headers="wq472">MIN</td>
<td headers="wq473">Returns the minimum value in a set of values</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scamin">MIN</a></td>
</tr>
<tr>
<td headers="wq472">NULLIF</td>
<td headers="wq473">Returns a null value if the arguments are equal, otherwise
it returns the value of the first argument</td>
<td headers="wq474"><a href="rbafzmstscale.htm#nullif">NULLIF</a></td>
</tr>
<tr>
<td headers="wq472">RAISE_ERROR</td>
<td headers="wq473">Raises an error with the specified SQLSTATE and message
text</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scaraiseerror">RAISE_ERROR</a></td>
</tr>
<tr>
<td headers="wq472">RRN</td>
<td headers="wq473">Returns the relative record number of a row</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scarrn">RRN</a></td>
</tr>
<tr>
<td headers="wq472">VALUE</td>
<td headers="wq473">Returns the first argument that is not null</td>
<td headers="wq474"><a href="rbafzmstscale.htm#scavalue">VALUE</a></td>
</tr>
</tbody>
</table>
<a name="wq475"></a>
<table id="wq475" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 34. Numeric Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq476" width="29%" align="left" valign="bottom">Function</th>
<th id="wq477" width="51%" align="left" valign="bottom">Description</th>
<th id="wq478" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq476">ABS</td>
<td headers="wq477">Returns the absolute value of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaabs">ABS</a></td>
</tr>
<tr>
<td headers="wq476">ACOS</td>
<td headers="wq477">Returns the arc cosine of a number, in radians</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaacos">ACOS</a></td>
</tr>
<tr>
<td headers="wq476">ANTILOG</td>
<td headers="wq477">Returns the anti-logarithm (base 10) of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaantilog">ANTILOG</a></td>
</tr>
<tr>
<td headers="wq476">ASIN</td>
<td headers="wq477">Returns the arc sine of a number, in radians</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaasin">ASIN</a></td>
</tr>
<tr>
<td headers="wq476">ATAN</td>
<td headers="wq477">Returns the arc tangent of a number, in radians</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaatan">ATAN</a></td>
</tr>
<tr>
<td headers="wq476">ATANH</td>
<td headers="wq477">Returns the hyperbolic arc tangent of a number, in radians</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaatanh">ATANH</a></td>
</tr>
<tr>
<td headers="wq476">ATAN2</td>
<td headers="wq477">Returns the arc tangent of x and y coordinates as an
angle expressed in radians</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaatan2">ATAN2</a></td>
</tr>
<tr>
<td headers="wq476">CEILING</td>
<td headers="wq477">Returns the smallest integer value that is greater than
or equal to a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaceiling">CEILING</a></td>
</tr>
<tr>
<td headers="wq476">COS</td>
<td headers="wq477">Returns the cosine of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scacos">COS</a></td>
</tr>
<tr>
<td headers="wq476">COSH</td>
<td headers="wq477">Returns the hyperbolic cosine of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scacosh">COSH</a></td>
</tr>
<tr>
<td headers="wq476">COT</td>
<td headers="wq477">Returns the cotangent of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scacot">COT</a></td>
</tr>
<tr>
<td headers="wq476">DEGREE</td>
<td headers="wq477">Returns the number of degrees of an angle</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scadegree">DEGREES</a></td>
</tr>
<tr>
<td headers="wq476">DIGITS</td>
<td headers="wq477">Returns a character-string representation of the absolute
value of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scadigits">DIGITS</a></td>
</tr>
<tr>
<td headers="wq476">EXP</td>
<td headers="wq477">Returns a value that is the base of the natural logarithm
(e) raised to a power specified by the argument</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaexp">EXP</a></td>
</tr>
<tr>
<td headers="wq476">FLOOR</td>
<td headers="wq477">Returns the largest integer value that is less than
or equal to a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scafloor">FLOOR</a></td>
</tr>
<tr>
<td headers="wq476">LN</td>
<td headers="wq477">Returns the natural logarithm of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaln">LN</a></td>
</tr>
<tr>
<td headers="wq476">LOG10</td>
<td headers="wq477">Returns the common logarithm (base 10) of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scalog">LOG10</a></td>
</tr>
<tr>
<td headers="wq476">MOD</td>
<td headers="wq477">Returns the remainder of the first argument divided
by the second argument</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scamod">MOD</a></td>
</tr>
<tr>
<td headers="wq476">MULTIPLY_ALT</td>
<td headers="wq477">Multiplies the first argument by the second argument
and returns the product</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scamultalt">MULTIPLY_ALT</a></td>
</tr>
<tr>
<td headers="wq476">PI</td>
<td headers="wq477">Returns the value of &pi;</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scapi">PI</a></td>
</tr>
<tr>
<td headers="wq476">POWER</td>
<td headers="wq477">Returns the result of raising the first argument to
the power of the second argument</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scapower">POWER</a></td>
</tr>
<tr>
<td headers="wq476">RADIANS</td>
<td headers="wq477">Returns the number of radians for an argument that is
expressed in degrees</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaradians">RADIANS</a></td>
</tr>
<tr>
<td headers="wq476">RAND</td>
<td headers="wq477">Returns a random number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scarand">RAND</a></td>
</tr>
<tr>
<td headers="wq476">ROUND</td>
<td headers="wq477">Returns a numeric value that has been rounded to the
specified number of decimal places</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scaround">ROUND</a></td>
</tr>
<tr>
<td headers="wq476">SIGN</td>
<td headers="wq477">Returns the sign of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scasign">SIGN</a></td>
</tr>
<tr>
<td headers="wq476">SIN</td>
<td headers="wq477">Returns the sine of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scasin">SIN</a></td>
</tr>
<tr>
<td headers="wq476">SINH</td>
<td headers="wq477">Returns the hyperbolic sine of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scasinh">SINH</a></td>
</tr>
<tr>
<td headers="wq476">SQRT</td>
<td headers="wq477">Returns the square root of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scasqrt">SQRT</a></td>
</tr>
<tr>
<td headers="wq476">TAN</td>
<td headers="wq477">Returns the tangent of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scatan">TAN</a></td>
</tr>
<tr>
<td headers="wq476">TANH</td>
<td headers="wq477">Returns the hyperbolic tangent of a number</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scatanh">TANH</a></td>
</tr>
<tr>
<td headers="wq476">TRUNCATE or TRUNC</td>
<td headers="wq477">Returns a number value that has been truncated at a
specified number of decimal places</td>
<td headers="wq478"><a href="rbafzmstscale.htm#scatrunc">TRUNCATE or TRUNC</a></td>
</tr>
</tbody>
</table>
<a name="wq479"></a>
<table id="wq479" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 35. String Scalar Functions</caption>
<thead valign="bottom">
<tr>
<th id="wq480" width="29%" align="left" valign="bottom">Function</th>
<th id="wq481" width="51%" align="left" valign="bottom">Description</th>
<th id="wq482" width="18%" align="left">Reference</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td headers="wq480">BIT_LENGTH</td>
<td headers="wq481">Returns the length of a string expression in bit</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scabitlen">BIT_LENGTH</a></td>
</tr>
<tr>
<td headers="wq480">CHARACTER_LENGTH</td>
<td headers="wq481">Returns the length of a string expression</td>
<td headers="wq482"><a href="rbafzmstscale.htm#charlenf">CHARACTER_LENGTH</a></td>
</tr>
<tr>
<td headers="wq480">CONCAT</td>
<td headers="wq481">Returns a string that is the concatenation of two strings</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaconcat">CONCAT</a></td>
</tr>
<tr>
<td headers="wq480">DECRYPT_BIT, DECRYPT_BINARY, DECRYPT_CHAR, and DECRYPT_DB</td>
<td headers="wq481">Decrypts an encrypted string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scadecrypt">DECRYPT_BIT, DECRYPT_BINARY, DECRYPT_CHAR and DECRYPT_DB</a></td>
</tr>
<tr>
<td headers="wq480">DIFFERENCE</td>
<td headers="wq481">Returns a value representing the difference between
the sounds of two strings</td>
<td headers="wq482"><a href="rbafzmstscale.htm#difffun">DIFFERENCE</a></td>
</tr>
<tr>
<td headers="wq480">ENCRYPT and ENCRYPT_RC2</td>
<td headers="wq481">Encrypts a string using the RC2 encryption algorithm</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaencrypt">ENCRYPT_RC2</a></td>
</tr>
<tr>
<td headers="wq480">ENCRYPT_TDES</td>
<td headers="wq481">Encrypts a string using the Triple DES encryption algorithm</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaencrypttdes">ENCRYPT_TDES</a></td>
</tr>
<tr>
<td headers="wq480">GETHINT</td>
<td headers="wq481">Returns a hint from an encrypted string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scagethint">GETHINT</a></td>
</tr>
<tr>
<td headers="wq480">INSERT</td>
<td headers="wq481">Returns a string where a substring is deleted and a
new string inserted in its place</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scainsert">INSERT</a></td>
</tr>
<tr>
<td headers="wq480">LAND</td>
<td headers="wq481">Returns a string that is the logical AND of the argument
strings</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaland">LAND</a></td>
</tr>
<tr>
<td headers="wq480">LCASE</td>
<td headers="wq481">Returns a string in which all the characters have been
converted to lowercase characters</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scalcase">LCASE</a></td>
</tr>
<tr>
<td headers="wq480">LEFT</td>
<td headers="wq481">Returns the leftmost characters from the string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaleft">LEFT</a></td>
</tr>
<tr>
<td headers="wq480">LNOT</td>
<td headers="wq481">Returns a string that is the logical NOT of the argument
string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scalnot">LNOT</a></td>
</tr>
<tr>
<td headers="wq480">LOCATE</td>
<td headers="wq481">Returns the starting position of one string within another
string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#locate">LOCATE</a></td>
</tr>
<tr>
<td headers="wq480">LOR</td>
<td headers="wq481">Returns a string that is the logical OR of the argument
strings</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scalor">LOR</a></td>
</tr>
<tr>
<td headers="wq480">LOWER</td>
<td headers="wq481">Returns a string in which all the characters have been
converted to lowercase characters</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scalower">LOWER</a></td>
</tr>
<tr>
<td headers="wq480">LTRIM</td>
<td headers="wq481">Returns a string in which blanks or hexadecimal zeroes
have been removed from the beginning of another string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaltrim">LTRIM</a></td>
</tr>
<tr>
<td headers="wq480">OCTET_LENGTH</td>
<td headers="wq481">Returns the length of a string expression in octets</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaoctetlen">OCTET_LENGTH</a></td>
</tr>
<tr>
<td headers="wq480">POSITION or POSSTR</td>
<td headers="wq481">Returns the starting position of one string within another
string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#posstr">POSITION or POSSTR</a></td>
</tr>
<tr>
<td headers="wq480">REPEAT</td>
<td headers="wq481">Returns a string composed of another string repeated
a number of times</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scarepeat">REPEAT</a></td>
</tr>
<tr>
<td headers="wq480">REPLACE</td>
<td headers="wq481">Returns a string where all occurrences of one string
are replaced by another string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scareplace">REPLACE</a></td>
</tr>
<tr>
<td headers="wq480">RIGHT</td>
<td headers="wq481">Returns the rightmost characters from the string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaright">RIGHT</a></td>
</tr>
<tr>
<td headers="wq480">RTRIM</td>
<td headers="wq481">Returns a string in which blanks or hexadecimal zeroes
have been removed from the end of another string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scartrim">RTRIM</a></td>
</tr>
<tr>
<td headers="wq480">SOUNDEX</td>
<td headers="wq481">Returns a character code representing the sound of the
words in the argument</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scasound">SOUNDEX</a></td>
</tr>
<tr>
<td headers="wq480">SPACE</td>
<td headers="wq481">Returns a character string that consists of a specified
number of blanks</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaspace">SPACE</a></td>
</tr>
<tr>
<td headers="wq480">STRIP</td>
<td headers="wq481">Removes blanks or another specified character from the
end or beginning of a string expression</td>
<td headers="wq482"><a href="rbafzmstscale.htm#strpfun">STRIP</a></td>
</tr>
<tr>
<td headers="wq480">SUBSTRING or SUBSTR</td>
<td headers="wq481">Returns a substring of a string</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scasubstr">SUBSTRING or SUBSTR</a></td>
</tr>
<tr>
<td headers="wq480">TRANSLATE</td>
<td headers="wq481">Returns a string in which one or more characters in
a string are converted to other characters</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scatrans">TRANSLATE</a></td>
</tr>
<tr>
<td headers="wq480">TRIM</td>
<td headers="wq481">Removes blanks or another specified character from the
end or beginning of a string expression</td>
<td headers="wq482"><a href="rbafzmstscale.htm#trimfun">TRIM</a></td>
</tr>
<tr>
<td headers="wq480">UCASE</td>
<td headers="wq481">Returns a string in which all the characters have been
converted to uppercase characters</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaucase">UCASE</a></td>
</tr>
<tr>
<td headers="wq480">UPPER</td>
<td headers="wq481">Returns a string in which all the characters have been
converted to uppercase characters</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaupper">UPPER</a></td>
</tr>
<tr>
<td headers="wq480">XOR</td>
<td headers="wq481">Returns a string that is the logical XOR of the argument
strings</td>
<td headers="wq482"><a href="rbafzmstscale.htm#scaxor">XOR</a></td>
</tr>
</tbody>
</table>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstch2srch.htm">Previous Page</a> | <a href="rbafzmstcolfunc.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
<a href="rbafzmstindex.htm#index">Index</a> ]
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
</body>
</html>