doc-exports/docs/dli/sqlreference/dli_08_0058.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2024-03-27 22:02:33 +00:00

267 lines
32 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="dli_08_0058"></a><a name="dli_08_0058"></a>
<h1 class="topictitle1">Primitive Data Types</h1>
<div id="body8662426"><p id="dli_08_0058__en-us_topic_0093946969_a1509de56abbe43be893dca2c4df215ca"><a href="#dli_08_0058__en-us_topic_0093946969_t8554599ebef94ea49cef6d24756f2cbf">Table 1</a> lists the primitive data types supported by DLI.</p>
<div class="tablenoborder"><a name="dli_08_0058__en-us_topic_0093946969_t8554599ebef94ea49cef6d24756f2cbf"></a><a name="en-us_topic_0093946969_t8554599ebef94ea49cef6d24756f2cbf"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0058__en-us_topic_0093946969_t8554599ebef94ea49cef6d24756f2cbf" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Primitive data types</caption><thead align="left"><tr id="dli_08_0058__en-us_topic_0093946969_ra66e456934274197a57187a88fb958cd"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.2.2.7.1.1"><p id="dli_08_0058__en-us_topic_0093946969_a1577e599640f4890ba43bd85eaba9ee7"><strong id="dli_08_0058__en-us_topic_0093946969_ac2ffdf562df14df69dec28b06ff890be">Data Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24%" id="mcps1.3.2.2.7.1.2"><p id="dli_08_0058__en-us_topic_0093946969_ac5c004085ecf4290943013a3f765f3ec"><strong id="dli_08_0058__en-us_topic_0093946969_a7a09c434ba1047c590585416e2e45c76">Description</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="10.979999999999999%" id="mcps1.3.2.2.7.1.3"><p id="dli_08_0058__en-us_topic_0093946969_ad920ee76dd654b0485fb71f42a495a2f"><strong id="dli_08_0058__en-us_topic_0093946969_a85226004ee4842eca6118cfa727f35de">Storage Space</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.61%" id="mcps1.3.2.2.7.1.4"><p id="dli_08_0058__en-us_topic_0093946969_a19405423ce174aaea81e0339666564e7"><strong id="dli_08_0058__en-us_topic_0093946969_b192981077214649">Value Range</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.71%" id="mcps1.3.2.2.7.1.5"><p id="dli_08_0058__en-us_topic_0093946969_p26366898114457"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706154527">Support by OBS Table</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.7%" id="mcps1.3.2.2.7.1.6"><p id="dli_08_0058__en-us_topic_0093946969_p4311259111458"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706154535">Support by DLI Table</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0058__en-us_topic_0093946969_r876c106ab7ce4050a7da8a4c13ec9efa"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a4e1631b999f745039b68b8e5d27000ab">INT</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_af31fa73b1e96494393427d976f373538">Signed integer</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_ac9fa5458a8224b3fbcbefbe1719a9b73">4 bytes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_af10c92092d4049868623653c47dbc3bf">2147483648 to 2147483647</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p55344021114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p245901411458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r0ab4c604cfef45b2962fc14b482d4d7d"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_acaa294c729e240c8a9ec4b6dbe7fe46f">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a40258709ca0048638f9e84a836cc6b34">String</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a7e30ac8546624938966395f5d2f22d6a">-</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a212b456234bf4c2a8415d301c651ab81">-</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p53680696114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p6496240811458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r2e97452e6b084a238d02ecc845be6610"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a411a248823c9475da5b5b08aa17e175e">FLOAT</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a5d59706e940543d8842b27ee26ed1156">Single-precision floating point</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a14647df40a3e43ccb2367dcd846709f8">4 bytes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a37708167a1cd4ce1a5069db88b73d873">-</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p53169091114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p2746371111458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r985742c3df9f4ff89d3c131dadbf3dc7"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a511f706304584c1ba5643d62d0bbd273">DOUBLE</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_ac9a7908d12ac4519a9f591211b74d13a">Double-precision floating-point</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a80dd57d4a78f41c095bf687add3f2819">8 bytes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a3504313d3c2440ba8fd2a4c0d90af99d">-</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p11729119114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p996814711458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r87b787a23b064f78b041c12d72f63bcb"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_ab7795dd28ae34f5bb34fc25902dfbee1">DECIMAL(precision,scale)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a94fd57a2f4c64ba7993ce19a2d4cd2ec">Decimal number. Data type of valid fixed places and decimal places, for example, 3.5.</p>
<ul id="dli_08_0058__ul11566162162911"><li id="dli_08_0058__li75667218297"><strong id="dli_08_0058__b0360172612399">precision</strong>: indicates the maximum number of digits that can be displayed.</li><li id="dli_08_0058__li85661329293"><strong id="dli_08_0058__b14567435394">scale</strong>: indicates the number of decimal places.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a90cb5b5b38b14deb808bcc07c208b978">-</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__p998292142816">1&lt;=precision&lt;=38</p>
<p id="dli_08_0058__p977742214288">0&lt;=scale&lt;=38</p>
<p id="dli_08_0058__p9123143032920">If <strong id="dli_08_0058__b33315184119">precision</strong> and <strong id="dli_08_0058__b1131116324110">scale</strong> are not specified, <strong id="dli_08_0058__b3968102317412">DECIMAL (38,38)</strong> is used by default.</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p10534579114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p211357911458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r9cf2f706b83d4db48e2676285975ead5"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a1570e7c6aec547e795306d45dfd836fc">BOOLEAN</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a48e849acb3dd441a9a7aa5982071f7a3">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a77a25fe800df4f71a1ee287d36425651">1 byte</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_abaae5ac5d84e42929d73d415347b9a8d">TRUE/FALSE</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p47994600114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p3698222411458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r20ff507900e74e73b25e3de6f3f158fc"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a9c3459894e5a4c9992797103c93b456c">SMALLINT/SHORT</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_ae02ccf68bb7b4f91a59a507781f7d75a">Signed integer</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a63ef416cb0724cb4b8501dc198ab6054">2 bytes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a419724ff1c14473186fe54777e265a0e">-32768~32767</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p62357414114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p4277015311458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r6fa34e6971044b44bb1e141248c35cac"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a8d078ad097dc47f49fa062af60f93a4e">TINYINT</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a31969eee939a4c19a93f09ad5c4e50fe">Signed integer</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a4fcfe9c475ac4ec080a6728fb3538006">1 byte</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a48d38047b3514982905c62a979281672">-128~127</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p17785748114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p4183036711458">No</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r17f1bc1bd0f24b73bfb080bff073292f"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a711d4ec9a2d2490e9bb36130f74b578e">BIGINT/LONG</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a50e5af56fe96434da001b045f2fdfbed">Signed integer</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a8ca8e565fc794d1787e6af97d735a2d1">8 bytes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a6c0fb3c6853e4cbc8bb91ae44e87a2e6">9223372036854775808 to 9223372036854775807</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p31359450114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p3281653711458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r91ddb57d4f6b49188e8da03502c5146f"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a62e459c38cfb47d09c33416f792819a5">TIMESTAMP</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a4a8dcf97005c40f88427d6673fa6cdd1">Timestamp in raw data format, indicating the date and time Example: 1621434131222</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_ab2794250d717440e9731694b756784f1">-</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_af0abb3ad3d1d4904ba3a7368d50d7646">-</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p57087521114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p4089382311458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_row46625912111351"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_p18602527111351">CHAR</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_p30409710111351">Fixed-length string</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_p47267470111351">-</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_p3459879111351">-</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p16657872114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p314059411458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_rb9fa3fa3a0c74c2883dd952a47f4fd12"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_ac51d06b3c03247d0a491e1570c59c893">VARCHAR</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a99ad87e5b639412eb6d0a2b9137bd8f3">Variable-length string</p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a19dd2cfccdc448d2860b0d4e2e14d531">-</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a0d90a54d10eb4a6da7f1bf765c403706">-</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p7110409114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p5306158211458">Yes</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r4b7f638356434109a2d52408e1e09971"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.7.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a7b4a0501d7aa4b24b74e1517ccdd3238">DATE</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.7.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_ac71b075dfa6b49f7b0051573ea4be9b6">Date type in the format of <strong id="dli_08_0058__b122514235428"><em id="dli_08_0058__i187701825164213">yyyy</em>-<em id="dli_08_0058__i133529144210">mm</em>-<em id="dli_08_0058__i4567433184215">dd</em></strong>, for example, <strong id="dli_08_0058__b1991704018429">2014-05-29</strong></p>
</td>
<td class="cellrowborder" valign="top" width="10.979999999999999%" headers="mcps1.3.2.2.7.1.3 "><p id="dli_08_0058__en-us_topic_0093946969_a16324e41f85e46d1a751a754a791c2b4">-</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.2.2.7.1.4 "><p id="dli_08_0058__en-us_topic_0093946969_a88dacb68ddea47a5b5ee3d3e074c9d42"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706141039">DATE</strong> does not contain time information. Its value ranges from <strong id="dli_08_0058__b163273580427">0000-01-01</strong> to <strong id="dli_08_0058__b1919192144310">9999-12-31</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="17.71%" headers="mcps1.3.2.2.7.1.5 "><p id="dli_08_0058__en-us_topic_0093946969_p39072226114457">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.7%" headers="mcps1.3.2.2.7.1.6 "><p id="dli_08_0058__en-us_topic_0093946969_p302091911458">Yes</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="dli_08_0058__en-us_topic_0093946969_note13205336143341"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dli_08_0058__en-us_topic_0093946969_ul5916610218393"><li id="dli_08_0058__en-us_topic_0093946969_li5497973418393">VARCHAR and CHAR data is stored in STRING type on DLI. Therefore, the string that exceeds the specified length will not be truncated.</li><li id="dli_08_0058__en-us_topic_0093946969_li1791975818396">FLOAT data is stored as DOUBLE data on DLI.</li></ul>
</div></div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s3fd96a757f754df4af005180d997834c"><h4 class="sectiontitle">INT</h4><p id="dli_08_0058__en-us_topic_0093946969_a3172e5e52d124b7190abf797dd78ff08">Signed integer with a storage space of 4 bytes. Its value ranges from 2147483648 to 2147483647. If this field is NULL, value 0 is used by default.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s2fed4222fc754407bdcecd755afe4530"><h4 class="sectiontitle">STRING</h4><p id="dli_08_0058__en-us_topic_0093946969_ab1a62456d0ec4ce1a94944f78c004037">String.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s1255dd68d61440f7bb4624c9a0afb3f5"><h4 class="sectiontitle">FLOAT</h4><p id="dli_08_0058__en-us_topic_0093946969_ac797ebfa89d3495983910b36022f3358">Single-precision floating point with a storage space of 4 bytes. If this field is NULL, value 0 is used by default.</p>
<p id="dli_08_0058__en-us_topic_0093946969_a45c4eb6818604a279f96c1f13d405c53">Due to the limitation of storage methods of floating point data, do not use the formula a==b to check whether two floating point values are the same. You are advised to use the formula: absolute value of (a-b) &lt;= EPSILON. EPSILON indicates the allowed error range which is usually 1.19209290E-07F. If the formula is satisfied, the compared two floating point values are considered the same.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_se27a426cfeb64228a8c72bdd71a1719c"><h4 class="sectiontitle">DOUBLE</h4><p id="dli_08_0058__en-us_topic_0093946969_a7539f726d80948b4a2f8e93545114c4e">Double-precision floating point with a storage space of 8 bytes. If this field is NULL, value 0 is used by default.</p>
<p id="dli_08_0058__en-us_topic_0093946969_ad000842a87844b079bbf4378cba63193">Due to the limitation of storage methods of floating point data, do not use the formula a==b to check whether two floating point values are the same. You are advised to use the formula: absolute value of (a-b) &lt;= EPSILON. EPSILON indicates the allowed error range which is usually 2.2204460492503131E-16. If the formula is satisfied, the compared two floating point values are considered the same.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_sba1492cd10004481816e1d69039a6490"><h4 class="sectiontitle">DECIMAL</h4><p id="dli_08_0058__en-us_topic_0093946969_a3caa9a7d87cc47aca32cdcb49b2e920f">Decimal(p,s) indicates that the total digit length is <strong id="dli_08_0058__en-us_topic_0093946969_b842352706161413">p</strong>, including <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616145">p s</strong> integer digits and <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616149">s</strong> fractional digits. <strong id="dli_08_0058__en-us_topic_0093946969_b842352706192610">p</strong> indicates the maximum number of decimal digits that can be stored, including the digits to both the left and right of the decimal point. The value of <strong id="dli_08_0058__en-us_topic_0093946969_b842352706192618">p</strong> ranges from 1 to 38. <strong id="dli_08_0058__en-us_topic_0093946969_b842352706192630">s</strong> indicates the maximum number of decimal digits that can be stored to the right of the decimal point. The fractional digits must be values ranging from 0 to <strong id="dli_08_0058__en-us_topic_0093946969_b84235270619299">p</strong>. The fractional digits can be specified only after significant digits are specified. Therefore, the following inequality is concluded: 0 ≤ <strong id="dli_08_0058__en-us_topic_0093946969_b84235270619308">s</strong><strong id="dli_08_0058__en-us_topic_0093946969_b842352706193011">p</strong>. For example, decimal (10,6) indicates that the value contains 10 digits, in which there are four integer digits and six fractional digits.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s623eeab913b24d019d361471c3f7e73d"><h4 class="sectiontitle">BOOLEAN</h4><p id="dli_08_0058__en-us_topic_0093946969_a3a99d3b8403a4ef883fe34cb52f74bc2">Boolean, which can be <strong id="dli_08_0058__en-us_topic_0093946969_b842352706161637">TRUE</strong> or <strong id="dli_08_0058__en-us_topic_0093946969_b842352706161617">FALSE</strong>.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_sce440519abdf41a5aa89fc7343eeac7c"><h4 class="sectiontitle">SMALLINT/SHORT</h4><p id="dli_08_0058__en-us_topic_0093946969_adc80c2d2663f4994ae4830708745e02e">Signed integer with a storage space of 2 bytes. Its value ranges from 32768 to 32767. If this field is NULL, value 0 is used by default.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s49eb4986028e4dc38757713cfeb30404"><h4 class="sectiontitle">TINYINT</h4><p id="dli_08_0058__en-us_topic_0093946969_aa048924b5bad405ca299a7b26075a7f1">Signed integer with a storage space of 1 byte. Its value ranges from 128 to 127. If this field is NULL, value 0 is used by default.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s01990391fac644a19a9e07556a0eeca5"><h4 class="sectiontitle">BIGINT/LONG</h4><p id="dli_08_0058__en-us_topic_0093946969_a0bdbab4085c5404ab65b0fd92e678ff3">Signed integer with a storage space of 8 bytes. Its value ranges from 9223372036854775808 to 9223372036854775807. It does not support scientific notation. If this field is NULL, value 0 is used by default.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_sd448b61418194d3095d5acdb8efb2519"><h4 class="sectiontitle">TIMESTAMP</h4><p id="dli_08_0058__en-us_topic_0093946969_aed42b60bcded4bd2a8ca6cc3762ce059">Legacy UNIX TIMESTAMP is supported, providing the precision up to the microsecond level. <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616279">TIMESTAMP</strong> is defined by the difference between the specified time and UNIX epoch (UNIX epoch time: 1970-01-01 00:00:00) in seconds. The data type <strong id="dli_08_0058__b191997451272">STRING</strong> can be implicitly converted to <strong id="dli_08_0058__b1410311479276">TIMESTAMP</strong>, but it must be in the <strong id="dli_08_0058__b938112192814">yyyy-MM-dd HH:mm:SS[.ffffff]</strong> format. The precision after the decimal point is optional.)</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_section5343054214381"><h4 class="sectiontitle">CHAR</h4><p id="dli_08_0058__en-us_topic_0093946969_p3965738814384">String with a fixed length. In DLI, the STRING type is used.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s860ebe75a3f0428980b452084ced6412"><h4 class="sectiontitle">VARCHAR</h4><p id="dli_08_0058__en-us_topic_0093946969_a501f438ac5064d498e0a4816ce6ef1f2"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706162840">VARCHAR</strong> is declared with a length that indicates the maximum number of characters in a string. During conversion from <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616294">STRING</strong> to <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616298">VARCHAR</strong>, if the number of characters in <strong id="dli_08_0058__en-us_topic_0093946969_b842352706162918">STRING</strong> exceeds the specified length, the excess characters of <strong id="dli_08_0058__en-us_topic_0093946969_b842352706162938">STRING</strong> are automatically trimmed. Similar to <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616306">STRING</strong>, the spaces at the end of <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163010">VARCHAR</strong> are meaningful and affect the comparison result. In DLI, the STRING type is used.</p>
</div>
<div class="section" id="dli_08_0058__en-us_topic_0093946969_s59c7d27331be44dbb72a4ae0bbe64584"><h4 class="sectiontitle">DATE</h4><p id="dli_08_0058__en-us_topic_0093946969_a93a18c2976444571bfcd4a253be01013"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706163042">DATE</strong> supports only explicit conversion (cast) with <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163047">DATE</strong>, <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163051">TIMESTAMP</strong>, and <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163056">STRING</strong>. For details, see <a href="#dli_08_0058__en-us_topic_0093946969_t15e381680c464657923c440b88e59cb9">Table 2</a>.</p>
<div class="tablenoborder"><a name="dli_08_0058__en-us_topic_0093946969_t15e381680c464657923c440b88e59cb9"></a><a name="en-us_topic_0093946969_t15e381680c464657923c440b88e59cb9"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0058__en-us_topic_0093946969_t15e381680c464657923c440b88e59cb9" frame="border" border="1" rules="all"><caption><b>Table 2 </b>cast function conversion</caption><thead align="left"><tr id="dli_08_0058__en-us_topic_0093946969_ra6447f9e0bcf4d9ca32ec18e5d326af2"><th align="left" class="cellrowborder" valign="top" width="30.45%" id="mcps1.3.16.3.2.3.1.1"><p id="dli_08_0058__en-us_topic_0093946969_a76696b039154475480caaa4a849d53c8"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706163121">Explicit Conversion</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69.55%" id="mcps1.3.16.3.2.3.1.2"><p id="dli_08_0058__en-us_topic_0093946969_a9fc4669972ab464db6a8d5cdb6efe64c"><strong id="dli_08_0058__en-us_topic_0093946969_b842352706163127">Conversion Result</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0058__en-us_topic_0093946969_rb665b6dfab864f188011489a4cc5bdc3"><td class="cellrowborder" valign="top" width="30.45%" headers="mcps1.3.16.3.2.3.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a6f225e731ca64bfd9c07058b683c8525">cast(date as date)</p>
</td>
<td class="cellrowborder" valign="top" width="69.55%" headers="mcps1.3.16.3.2.3.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_aa14a7b781c7740229ba131e77279c468">Same as value of <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163141">DATE</strong>.</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r35a6b55add55431e96ef4f7b5de6f0f8"><td class="cellrowborder" valign="top" width="30.45%" headers="mcps1.3.16.3.2.3.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a1145e396263649f1a921a246ff3f6268">cast(timestamp as date)</p>
</td>
<td class="cellrowborder" valign="top" width="69.55%" headers="mcps1.3.16.3.2.3.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_aeeaa0fd4eb1944e88c01baa574e89db1">The date (yyyy-mm-dd) is obtained from <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616323">TIMESTAMP</strong> based on the local time zone and returned as the value of <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616326">DATE</strong>.</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_ra9adac60e5d24dc9a01fe0ccea76838b"><td class="cellrowborder" valign="top" width="30.45%" headers="mcps1.3.16.3.2.3.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a4797d9057bcb4fdea32e413e9053b507">cast(string as date)</p>
</td>
<td class="cellrowborder" valign="top" width="69.55%" headers="mcps1.3.16.3.2.3.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a9759af40fa324b01a43700eb3dc13eb1">If the STRING is in the <span class="parmvalue" id="dli_08_0058__en-us_topic_0093946969_parmvalue1917679371163227"><b>yyyy-MM-dd</b></span> format, the corresponding date (yyyy-mm-dd) is returned as the value of <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163238">DATE</strong>. If the STRING is not in the <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616331">yyyy-MM-dd</strong> format, <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616338">NULL</strong> is returned.</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_r93c5c143a3d54d38816828ac0b6b5e22"><td class="cellrowborder" valign="top" width="30.45%" headers="mcps1.3.16.3.2.3.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_a8a96eb274a554e40931c1067813fc55c">cast(date as timestamp)</p>
</td>
<td class="cellrowborder" valign="top" width="69.55%" headers="mcps1.3.16.3.2.3.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_ae4e3da1847c046b89f22122f0e727041">Timestamp that maps to the zero hour of the date (yyyy-mm-dd) specified by <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163359">DATE</strong> is generated based on the local time zone and returned as the value of <strong id="dli_08_0058__en-us_topic_0093946969_b84235270616349">DATE</strong>.</p>
</td>
</tr>
<tr id="dli_08_0058__en-us_topic_0093946969_rb73c3cdceadb408d9faac0b1adc2fe0c"><td class="cellrowborder" valign="top" width="30.45%" headers="mcps1.3.16.3.2.3.1.1 "><p id="dli_08_0058__en-us_topic_0093946969_aa2db7e0fbcbc4b67a1ac3ceffd89e151">cast(date as string)</p>
</td>
<td class="cellrowborder" valign="top" width="69.55%" headers="mcps1.3.16.3.2.3.1.2 "><p id="dli_08_0058__en-us_topic_0093946969_a67f673813a724f748d6755b94c6defa7">A STRING in the <span class="parmvalue" id="dli_08_0058__en-us_topic_0093946969_parmvalue607614349163430"><b>yyyy-MM-dd</b></span> format is generated based on the date (yyyy-mm-dd) specified by <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163440">DATE</strong> and returned as the value of <strong id="dli_08_0058__en-us_topic_0093946969_b842352706163443">DATE</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0056.html">Data Types</a></div>
</div>
</div>