-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathteradata.html
171 lines (151 loc) · 7.19 KB
/
teradata.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>6.20. Teradata Functions — Presto 0.161 Documentation</title>
<link rel="stylesheet" href="../_static/presto.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.161',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Presto 0.161 Documentation" href="../index.html" />
<link rel="up" title="6. Functions and Operators" href="../functions.html" />
<link rel="next" title="7. SQL Language" href="../language.html" />
<link rel="prev" title="6.19. Lambda Expressions and Functions" href="lambda.html" />
</head>
<body role="document">
<div class="header">
<h1 class="heading"><a href="../index.html">
<span>Presto 0.161 Documentation</span></a></h1>
<h2 class="heading"><span>6.20. Teradata Functions</span></h2>
</div>
<div class="topnav">
<p class="nav">
<span class="left">
« <a href="lambda.html">6.19. Lambda Expressions and Functions</a>
</span>
<span class="right">
<a href="../language.html">7. SQL Language</a> »
</span>
</p>
</div>
<div class="content">
<div class="section" id="teradata-functions">
<h1>6.20. Teradata Functions</h1>
<p>These functions provide compatibility with Teradata SQL.</p>
<div class="section" id="string-functions">
<h2>String Functions</h2>
<dl class="function">
<dt id="char2hexint">
<code class="descname">char2hexint</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span> → varchar</dt>
<dd><p>Returns the hexadecimal representation of the UTF-16BE encoding of the string.</p>
</dd></dl>
<dl class="function">
<dt id="index">
<code class="descname">index</code><span class="sig-paren">(</span><em>string</em>, <em>substring</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Alias for <a class="reference internal" href="string.html#strpos" title="strpos"><code class="xref py py-func docutils literal"><span class="pre">strpos()</span></code></a> function.</p>
</dd></dl>
<dl class="function">
<dt id="substring">
<code class="descname">substring</code><span class="sig-paren">(</span><em>string</em>, <em>start</em><span class="sig-paren">)</span> → varchar</dt>
<dd><p>Alias for <a class="reference internal" href="string.html#substr" title="substr"><code class="xref py py-func docutils literal"><span class="pre">substr()</span></code></a> function.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">substring</code><span class="sig-paren">(</span><em>string</em>, <em>start</em>, <em>length</em><span class="sig-paren">)</span> → varchar</dt>
<dd><p>Alias for <a class="reference internal" href="string.html#substr" title="substr"><code class="xref py py-func docutils literal"><span class="pre">substr()</span></code></a> function.</p>
</dd></dl>
</div>
<div class="section" id="date-functions">
<h2>Date Functions</h2>
<p>The functions in this section use a format string that is compatible with
the Teradata datetime functions. The following table, based on the
Teradata reference manual, describes the supported format specifiers:</p>
<table border="1" class="docutils">
<colgroup>
<col width="31%" />
<col width="69%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Specifier</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal"><span class="pre">-</span> <span class="pre">/</span> <span class="pre">,</span> <span class="pre">.</span> <span class="pre">;</span> <span class="pre">:</span></code></td>
<td>Punctuation characters are ignored</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">dd</span></code></td>
<td>Day of month (1-31)</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">hh</span></code></td>
<td>Hour of day (1-12)</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">hh24</span></code></td>
<td>Hour of the day (0-23)</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">mi</span></code></td>
<td>Minute (0-59)</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">mm</span></code></td>
<td>Month (01-12)</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">ss</span></code></td>
<td>Second (0-59)</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">yyyy</span></code></td>
<td>4-digit year</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">yy</span></code></td>
<td>2-digit year</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Case insensitivity is not currently supported. All specifiers must be lowercase.</p>
</div>
<dl class="function">
<dt id="to_char">
<code class="descname">to_char</code><span class="sig-paren">(</span><em>timestamp</em>, <em>format</em><span class="sig-paren">)</span> → varchar</dt>
<dd><p>Formats <code class="docutils literal"><span class="pre">timestamp</span></code> as a string using <code class="docutils literal"><span class="pre">format</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="to_timestamp">
<code class="descname">to_timestamp</code><span class="sig-paren">(</span><em>string</em>, <em>format</em><span class="sig-paren">)</span> → timestamp</dt>
<dd><p>Parses <code class="docutils literal"><span class="pre">string</span></code> into a <code class="docutils literal"><span class="pre">TIMESTAMP</span></code> using <code class="docutils literal"><span class="pre">format</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="to_date">
<code class="descname">to_date</code><span class="sig-paren">(</span><em>string</em>, <em>format</em><span class="sig-paren">)</span> → date</dt>
<dd><p>Parses <code class="docutils literal"><span class="pre">string</span></code> into a <code class="docutils literal"><span class="pre">DATE</span></code> using <code class="docutils literal"><span class="pre">format</span></code>.</p>
</dd></dl>
</div>
</div>
</div>
<div class="bottomnav">
<p class="nav">
<span class="left">
« <a href="lambda.html">6.19. Lambda Expressions and Functions</a>
</span>
<span class="right">
<a href="../language.html">7. SQL Language</a> »
</span>
</p>
</div>
<div class="footer" role="contentinfo">
</div>
</body>
</html>