forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
758 lines
80 KiB
HTML
758 lines
80 KiB
HTML
<a name="EN-US_TOPIC_0000001188681004"></a><a name="EN-US_TOPIC_0000001188681004"></a>
|
|
|
|
<h1 class="topictitle1">Basic Data Types</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1449751153020"><h4 class="sectiontitle">Overview</h4><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p18384172753010">MySQL supports a number of basic data types, including numeric, date/time, string (character), LOB, set, binary, and Boolean types. <span id="EN-US_TOPIC_0000001188681004__text10892754124514">GaussDB(DWS)</span> does not support some basic MySQL data types, precision settings of some MySQL data types, or some MySQL keywords such as <strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b14405437270">UNSIGNED</strong> and <strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b24419437279">ZEROFILL</strong>. DSC performs migration based on GaussDB support.</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p16885173317307">A data type is a basic data attribute. Occupied storage space and allowed operations vary according to data types. In a database, data is stored in tables, in which a data type is specified for each column. Data in the column must be of its allowed data type. For details of each types description, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_table1858310435332">Table 1</a></p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_table1858310435332"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_table1858310435332"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_table1858310435332" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Basic description of data types</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row10583164319338"><th align="left" class="cellrowborder" valign="top" width="16.520000000000003%" id="mcps1.3.1.4.2.3.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p1258334312333"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b1218274219111">Data Types</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="83.48%" id="mcps1.3.1.4.2.3.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p458318435339"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b102071242213">Basic Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row358319432335"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p5584843123312">Numeric Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p19584104311336">For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section13238133084213">Numeric Types</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row12584114333315"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p19584143153317">Date/Time Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p17584194317332">This document describes the following <strong id="EN-US_TOPIC_0000001188681004__b65027305714">date/time</strong> types: <strong id="EN-US_TOPIC_0000001188681004__b68145379713">DATETIME</strong>, <strong id="EN-US_TOPIC_0000001188681004__b1041813409714">TIME</strong>, <strong id="EN-US_TOPIC_0000001188681004__b1076211431077">TIMESTAMP</strong>, and <strong id="EN-US_TOPIC_0000001188681004__b17301045877">YEAR</strong>. <span id="EN-US_TOPIC_0000001188681004__text1643474674616">GaussDB(DWS)</span> does not support these types, and DSC will convert them. For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1756223318421">Date/Time Types</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row1584124310337"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p17584543183319">String Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p2584543103316">MySQL interprets length specifications in character column definitions in character units. This applies to the CHAR, VARCHAR, and TEXT types. For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section18212113419426">String Types</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row7584184320330"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p1058419437332">Spatial Data Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p1958418439332">MySQL has spatial data types corresponding to the OpenGIS class. For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section2333153511421">Spatial Data Types</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row1584134313313"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p195841843143314">LOB Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p758404333317">A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB. The only difference between these four types is the maximum length of the values they can contain. For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section135036144211">LOB Types</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row9584104317333"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p8584204314336">Set Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><ol id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164602_ol165921580410"><li id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164602_li959275819413">In MySQL, an ENUM is a string object with a value chosen from a list of permitted values that are enumerated explicitly in the column specification at table creation.</li><li id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_li185851147173812">A SET is a string object that can have zero or more values, each of which must be chosen from a list of permitted values specified when the table is created.<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p05572481381"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_li185851147173812"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_li185851147173812"></a>For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1818193619424">Set Types</a>.</p>
|
|
</li></ol>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row20418145083311"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p204181550113320">Boolean Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p141812508331">MySQL supports both BOOL and BOOLEAN. For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1540624204220">Boolean Types</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_row15584184311334"><td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p16584164313313">Binary Types</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.48%" headers="mcps1.3.1.4.2.3.1.2 "><ol id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_ol10308142973911"><li id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_li108171311396">In MySQL, the BIT data type is used to store bit values. A type of BIT(<em id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_i162221124131413">M</em>) enables storage of <em id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_i182221424161416">M</em>-bit values. <em id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_i6222192461415">M</em> can range from 1 to 64.</li><li id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_li131811346396">MySQL BINARY and VARBINARY types are similar to CHAR and VARCHAR, except that they contain binary strings rather than non-binary strings.<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_p19174351395"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_li131811346396"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_li131811346396"></a>For details, see <a href="#EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section14212134405">Binary Types</a>.</p>
|
|
</li></ol>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section13238133084213"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section13238133084213"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section13238133084213"></a><h4 class="sectiontitle">Numeric Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_table15586181111301" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Numeric type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row6587101103014"><th align="left" class="cellrowborder" valign="top" width="16.831683168316832%" id="mcps1.3.2.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p45871011163017">MySQL Numeric Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40.02400240024002%" id="mcps1.3.2.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p95871511193010">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="43.14431443144314%" id="mcps1.3.2.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p10587311133016"><span id="EN-US_TOPIC_0000001188681004__text127256554468">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row85878114301"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1145525803310">DEC</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p6122191643116">DEC</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p191227165310">DEC[(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p4495122123113">DECIMAL</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1049542133119">DECIMAL[(M[,D])]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row191946512325"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1734893103419">DECIMAL</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1412261633113">DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p4495162110313">DECIMAL[(M[,D])]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row2587191114302"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p16544194317349">DOUBLE PRECISION</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p172971727173114">DOUBLE PRECISION</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p929792716312">DOUBLE PRECISION [(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p153531132153112">FLOAT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p83531932113119">FLOAT[(M)]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row11587111203020"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p198421349153414">DOUBLE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1758781116308">DOUBLE[(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p458771193013">FLOAT[(M)]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row1158741117304"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1339218548348">FIXED</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1264214483317">FIXED</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1643124819315">FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p12045323110">DECIMAL</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p190453153111">DECIMAL[(M[,D])]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row105882011133018"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p957655913341">FLOAT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1019519591315">FLOAT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p11195159173111">FLOAT [(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p17195205910315">FLOAT(p) [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1576212393218">FLOAT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p16762333326">FLOAT[(M)]</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1762234321">FLOAT(p)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row1360919715329"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p561115710329">INT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p12599171083518">INT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p15998109355">INT(p) [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1149371693510">INTEGER</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p7493121612358">INTEGER(p)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row788961711328"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p18891517183215">INTEGER</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1395152910355">INTEGER</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1595829153518">INTEGER(p) [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p69541137153512">INTEGER</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p495423720352">INTEGER(p)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row196471026153212"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1864702623214">MEDIUMINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p2847114311357">MEDIUMINT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p14847194312357">MEDIUMINT(p) [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p114588495358">INTEGER</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1458164903515">INTEGER(p)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row878102933220"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p978029123212">NUMERIC</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p763725413352">NUMERIC</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p11637145413514">NUMERIC [(M[,D])] [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p519685983512">DECIMAL</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p15196165914357">DECIMAL[(M[,D])]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row16648133211323"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p6649183263220">REAL</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p864913233216">REAL[(M[,D])]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p18649732173218">FLOAT[(M)]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row1659616173618"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p136013160365">SMALLINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p193163592368">SMALLINT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p4316959113611">SMALLINT(p) [UNSIGNED] [ZEROFILL]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1560516143613">SMALLINT</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_row1947011528367"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1447015528365">TINYINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.02400240024002%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1533512820374">TINYINT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p183351387371">TINYINT(n)</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p113353873716">TINYINT(n) ZEROFILL</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1433528103713">TINYINT(n) UNSIGNED ZEROFILL</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.14431443144314%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p14111613113716">TINYINT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p16411413113711">TINYINT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1741151313719">TINYINT</p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p1411191316377">SMALLINT</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p16911452145619"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b1450214111291">Input: TINYINT</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_screen20267101225912">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` TINYINT,
|
|
`dataType_2` TINYINT(0),
|
|
`dataType_3` TINYINT(255),
|
|
`dataType_4` TINYINT(255) UNSIGNED ZEROFILL,
|
|
`dataType_5` TINYINT(255) ZEROFILL
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_p0250919155915"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b8502911112910">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164566_screen38651030125919">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" TINYINT,
|
|
"datatype_2" TINYINT,
|
|
"datatype_3" TINYINT,
|
|
"datatype_4" SMALLINT,
|
|
"datatype_5" TINYINT
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1756223318421"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1756223318421"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section1756223318421"></a><h4 class="sectiontitle">Date/Time Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_table10117648917" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Date/Time type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_row211754814117"><th align="left" class="cellrowborder" valign="top" width="15.261526152615263%" id="mcps1.3.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p1813718121298">MySQL Date/Time Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.94419441944194%" id="mcps1.3.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p132812189918">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.7942794279428%" id="mcps1.3.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p990525598"><span id="EN-US_TOPIC_0000001188681004__text877618461010">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_row191171848612"><td class="cellrowborder" valign="top" width="15.261526152615263%" headers="mcps1.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p2117144817114">DATETIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.94419441944194%" headers="mcps1.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p17246154911118">DATETIME[(fsp)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.7942794279428%" headers="mcps1.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p14117748117">TIMESTAMP[(fsp)] WITHOUT TIME ZONE</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_row811754814114"><td class="cellrowborder" valign="top" width="15.261526152615263%" headers="mcps1.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p1311716481914">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.94419441944194%" headers="mcps1.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p17333112414198">TIME[(fsp)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.7942794279428%" headers="mcps1.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p1048028132215">TIME[(fsp)] WITHOUT TIME ZONE</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_row849212317819"><td class="cellrowborder" valign="top" width="15.261526152615263%" headers="mcps1.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p101171948213">TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.94419441944194%" headers="mcps1.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p0297138191114">TIMESTAMP[(fsp)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.7942794279428%" headers="mcps1.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p2493231986">TIMESTAMP[(fsp)] WITH TIME ZONE</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_row121184481113"><td class="cellrowborder" valign="top" width="15.261526152615263%" headers="mcps1.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p181182480115">YEAR</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.94419441944194%" headers="mcps1.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p415210743813">YEAR[(4)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.7942794279428%" headers="mcps1.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p31181048018">VARCHAR(4)</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_note1544699172110"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p144614942110">The value of <em id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_i19250195042917">fsp</em> must be in the range [0, 6]. Value <strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b142501350142910">0</strong> indicates no decimal. If this parameter is omitted, the default precision will be 0.</p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p816910530159"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b1625010504294">Input: DATETIME</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen14680186141612">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` DATETIME,
|
|
`dataType_2` DATETIME(0),
|
|
`dataType_3` DATETIME(6),
|
|
`dataType_4` DATETIME DEFAULT NULL,
|
|
`dataType_5` DATETIME DEFAULT '2018-10-12 15:27:33.999999'
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p187956221168"><strong id="EN-US_TOPIC_0000001188681004__b870183127">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen7538163431614">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" TIMESTAMP WITHOUT TIME ZONE,
|
|
"datatype_2" TIMESTAMP(0) WITHOUT TIME ZONE,
|
|
"datatype_3" TIMESTAMP(6) WITHOUT TIME ZONE,
|
|
"datatype_4" TIMESTAMP WITHOUT TIME ZONE DEFAULT NULL,
|
|
"datatype_5" TIMESTAMP WITHOUT TIME ZONE DEFAULT '2018-10-12 15:27:33.999999'
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p1471211198174"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b8250550142917">Input: TIME</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen141821659172213">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` TIME DEFAULT '20:58:10',
|
|
`dataType_2` TIME(3) DEFAULT '20:58:10',
|
|
`dataType_3` TIME(6) DEFAULT '20:58:10',
|
|
`dataType_4` TIME(6) DEFAULT '2018-10-11 20:00:00',
|
|
`dataType_5` TIME(6) DEFAULT '20:58:10.01234',
|
|
`dataType_6` TIME(6) DEFAULT '2018-10-11 20:00:00.01234',
|
|
`dataType_7` TIME DEFAULT NULL,
|
|
`dataType_8` TIME(6) DEFAULT NULL,
|
|
PRIMARY KEY (dataType_1)
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p342311319232"><strong id="EN-US_TOPIC_0000001188681004__b750992579">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen6668112115232">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" TIME WITHOUT TIME ZONE DEFAULT '20:58:10',
|
|
"datatype_2" TIME(3) WITHOUT TIME ZONE DEFAULT '20:58:10',
|
|
"datatype_3" TIME(6) WITHOUT TIME ZONE DEFAULT '20:58:10',
|
|
"datatype_4" TIME(6) WITHOUT TIME ZONE DEFAULT '2018-10-11 20:00:00',
|
|
"datatype_5" TIME(6) WITHOUT TIME ZONE DEFAULT '20:58:10.01234',
|
|
"datatype_6" TIME(6) WITHOUT TIME ZONE DEFAULT '2018-10-11 20:00:00.01234',
|
|
"datatype_7" TIME WITHOUT TIME ZONE DEFAULT NULL,
|
|
"datatype_8" TIME(6) WITHOUT TIME ZONE DEFAULT NULL,
|
|
PRIMARY KEY ("datatype_1")
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p173051253132315"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b9251125012296">Input: TIMESTAMP</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen1540911813244">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` TIMESTAMP,
|
|
`dateType_4` TIMESTAMP DEFAULT '2018-10-12 15:27:33',
|
|
`dateType_5` TIMESTAMP DEFAULT '2018-10-12 15:27:33.999999',
|
|
`dateType_6` TIMESTAMP DEFAULT '2018-10-12 15:27:33',
|
|
`dateType_7` TIMESTAMP DEFAULT '2018-10-12 15:27:33',
|
|
`dataType_8` TIMESTAMP(0) DEFAULT '2018-10-12 15:27:33',
|
|
`dateType_9` TIMESTAMP(6) DEFAULT '2018-10-12 15:27:33'
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p1842112313362"><strong id="EN-US_TOPIC_0000001188681004__b639024622">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen126483333364">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" TIMESTAMP WITH TIME ZONE,
|
|
"datetype_4" TIMESTAMP WITH TIME ZONE DEFAULT '2018-10-12 15:27:33',
|
|
"datetype_5" TIMESTAMP WITH TIME ZONE DEFAULT '2018-10-12 15:27:33.999999',
|
|
"datetype_6" TIMESTAMP WITH TIME ZONE DEFAULT '2018-10-12 15:27:33',
|
|
"datetype_7" TIMESTAMP WITH TIME ZONE DEFAULT '2018-10-12 15:27:33',
|
|
"datatype_8" TIMESTAMP(0) WITH TIME ZONE DEFAULT '2018-10-12 15:27:33',
|
|
"datetype_9" TIMESTAMP(6) WITH TIME ZONE DEFAULT '2018-10-12 15:27:33'
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p4692849164111"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b1125175072919">Input: YEAR</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen18889171234212">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` YEAR,
|
|
`dataType_2` YEAR(4),
|
|
`dataType_3` YEAR DEFAULT '2018',
|
|
`dataType_4` TIME DEFAULT NULL
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_p17991163914424"><strong id="EN-US_TOPIC_0000001188681004__b97769793">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164385_screen1997195164217">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" VARCHAR(4),
|
|
"datatype_2" VARCHAR(4),
|
|
"datatype_3" VARCHAR(4) DEFAULT '2018',
|
|
"datatype_4" TIME WITHOUT TIME ZONE DEFAULT NULL
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section18212113419426"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section18212113419426"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section18212113419426"></a><h4 class="sectiontitle">String Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_table4723653184710" frame="border" border="1" rules="all"><caption><b>Table 4 </b>String type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row872415318474"><th align="left" class="cellrowborder" valign="top" width="16.301630163016302%" id="mcps1.3.4.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p8724205317473">MySQL String Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40.63406340634063%" id="mcps1.3.4.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p17724553194715">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="43.064306430643065%" id="mcps1.3.4.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1672435312473"><span id="EN-US_TOPIC_0000001188681004__text2780154181017">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row14724165324710"><td class="cellrowborder" valign="top" width="16.301630163016302%" headers="mcps1.3.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p272455310476">CHAR</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.63406340634063%" headers="mcps1.3.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1172425354712">CHAR[(0)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.064306430643065%" headers="mcps1.3.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p572475319478">CHAR[(1)]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row1072485319474"><td class="cellrowborder" valign="top" width="16.301630163016302%" headers="mcps1.3.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p177242539473">LONGTEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.63406340634063%" headers="mcps1.3.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p77241953204716">LONGTEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.064306430643065%" headers="mcps1.3.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p15724105310475">TEXT</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row1372435384716"><td class="cellrowborder" valign="top" width="16.301630163016302%" headers="mcps1.3.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p117241753184718">MEDIUMTEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.63406340634063%" headers="mcps1.3.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p127241253154714">MEDIUMTEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.064306430643065%" headers="mcps1.3.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p137241253124711">TEXT</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row6724153204711"><td class="cellrowborder" valign="top" width="16.301630163016302%" headers="mcps1.3.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p37246532473">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.63406340634063%" headers="mcps1.3.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p7724125315478">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.064306430643065%" headers="mcps1.3.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p47241532472">TEXT</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row1272475324711"><td class="cellrowborder" valign="top" width="16.301630163016302%" headers="mcps1.3.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1872465318474">TINYTEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.63406340634063%" headers="mcps1.3.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1172410531476">TINYTEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.064306430643065%" headers="mcps1.3.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p197245538472">TEXT</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_row4724205314719"><td class="cellrowborder" valign="top" width="16.301630163016302%" headers="mcps1.3.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1072405316473">VARCHAR</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40.63406340634063%" headers="mcps1.3.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p27241553134720">VARCHAR[(0)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.064306430643065%" headers="mcps1.3.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p3299187172314">VARCHAR[(1)]</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1332213218563"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b18473122683011">Input: CHAR</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p12944152105919">In MySQL, the length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value from 0 to 255. When CHAR values are stored, they are right-padded with spaces to the specified length.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_screen5757445165618">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` CHAR NOT NULL,
|
|
`dataType_2` CHAR(0) NOT NULL,
|
|
`dataType_3` CHAR(255) NOT NULL
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p1450505613564"><strong id="EN-US_TOPIC_0000001188681004__b1951838360">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_screen664112985711">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" CHAR NOT NULL,
|
|
"datatype_2" CHAR(1) NOT NULL,
|
|
"datatype_3" CHAR(255) NOT NULL
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p7451444139"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b347472616303">Input: [LONG|MEDIUM|TINY]TEXT</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_screen65801418121312">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` LONGTEXT,
|
|
`dataType_2` MEDIUMTEXT,
|
|
`dataType_3` TEXT,
|
|
`dataType_4` TINYTEXT
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p173603223130"><strong id="EN-US_TOPIC_0000001188681004__b822577927">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_screen832373451312">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" TEXT,
|
|
"datatype_2" TEXT,
|
|
"datatype_3" TEXT,
|
|
"datatype_4" TEXT
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p96511315182316"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b12474726193017">Input: VARCHAR</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p753071482610">In MySQL, values in VARCHAR columns are variable-length strings. The length can be any value from 0 to 65,535.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_screen7921134313234">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` VARCHAR(0),
|
|
`dataType_2` VARCHAR(1845)
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_p66121142414"><strong id="EN-US_TOPIC_0000001188681004__b542554441">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164778_screen1814519189245">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" VARCHAR(1),
|
|
"datatype_2" VARCHAR(1845)
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section2333153511421"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section2333153511421"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section2333153511421"></a><h4 class="sectiontitle">Spatial Data Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_table416618512410" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Spatial type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row171679516415"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.5.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p171678594113">MySQL Spatial Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.5.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p31671512417">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.5.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p1672435312473"><span id="EN-US_TOPIC_0000001188681004__text1784646108">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row1316714518414"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p9167452410">GEOMETRY</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p131679534116">GEOMETRY</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p616735134110">CIRCLE</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row13167254414"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p816745164117">POINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p216712519418">POINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p61673554117">POINT</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row71677514410"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p10167175204110">LINESTRING</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p201678544113">LINESTRING</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p116719511413">POLYGON</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row1516745114117"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p316710517417">POLYGON</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p016714515413">POLYGON</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p71675510419">POLYGON</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row31671534112"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p131679564115">MULTIPOINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p141671456416">MULTIPOINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p316718510411">BOX</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row201678584118"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p13167259411">MULTILINESTRING</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p21672511417">MULTILINESTRING</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p1716795184111">BOX</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row101671657412"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p41679524119">MULTIPOLYGON</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p131671510417">MULTIPOLYGON</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p216715510415">POLYGON</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_row1616711518419"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p81681755411">GEOMETRYCOLLECTION</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p1916865124117">GEOMETRYCOLLECTION</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p916875204119">CIRCLE</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_ul1061615108448"><li id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_li1361771084414">GEOMETRY can store geometry values of any type. The other single-value types (POINT, LINESTRING, and POLYGON) restrict their values to a particular geometry type.</li><li id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_li2090742314415">GEOMETRYCOLLECTION can store a collection of objects of any type. The other collection types (MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION) restrict collection members to those having a particular geometry type.<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p989113244418"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_li2090742314415"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_li2090742314415"></a><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b1894020595308">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_screen2523452194418">CREATE TABLE `t_geo_test2` (
|
|
`id` int(11) NOT NULL,
|
|
`name` varchar(255),
|
|
`geometry_1` geometry NOT NULL,
|
|
`point_1` point NOT NULL,
|
|
`linestring_1` linestring NOT NULL,
|
|
`polygon_1` polygon NOT NULL,
|
|
`multipoint_1` multipoint NOT NULL,
|
|
`multilinestring_1` multilinestring NOT NULL,
|
|
`multipolygon_1` multipolygon NOT NULL,
|
|
`geometrycollection_1` geometrycollection NOT NULL,
|
|
PRIMARY KEY (`id`) USING BTREE
|
|
) ENGINE = InnoDB;</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_p885717332454"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b16940959153016">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164710_screen19963745134517">CREATE TABLE "public"."t_geo_test2"
|
|
(
|
|
"id" INTEGER(11) NOT NULL,
|
|
"name" VARCHAR(255),
|
|
"geometry_1" CIRCLE NOT NULL,
|
|
"point_1" POINT NOT NULL,
|
|
"linestring_1" POLYGON NOT NULL,
|
|
"polygon_1" POLYGON NOT NULL,
|
|
"multipoint_1" BOX NOT NULL,
|
|
"multilinestring_1" BOX NOT NULL,
|
|
"multipolygon_1" POLYGON NOT NULL,
|
|
"geometrycollection_1" CIRCLE NOT NULL,
|
|
PRIMARY KEY ("id")
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section135036144211"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section135036144211"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section135036144211"></a><h4 class="sectiontitle">LOB Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_table2963807555" frame="border" border="1" rules="all"><caption><b>Table 6 </b>LOB type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_row69651305552"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p8965120175510">MySQL LOB Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p119659014558">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p18965106550"><span id="EN-US_TOPIC_0000001188681004__text18787204141018">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_row14965909554"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p696570155519">TINYBLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p1296520015520">TINYBLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p169655005510">BLOB</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_row1996511017553"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p1496590115511">BLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p296511095519">BLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p596512012556">BLOB</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_row1596515014551"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p3965140155513">MEDIUMBLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p19652005556">MEDIUMBLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p139653014558">BLOB</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_row596515013552"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p9965130105517">LONGBLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p19656014553">LONGBLOB</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p896519010552">BLOB</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p18363951165611"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b10811350183118">Input: [TINY|MEDIUM|LONG]BLOB</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_screen15454174275716">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` BIGINT,
|
|
`dataType_2` TINYBLOB,
|
|
`dataType_3` BLOB,
|
|
`dataType_4` MEDIUMBLOB,
|
|
`dataType_5` LONGBLOB
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_p39841145500"><strong id="EN-US_TOPIC_0000001188681004__b690137485">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164666_screen19867711119">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" BIGINT,
|
|
"datatype_2" BLOB,
|
|
"datatype_3" BLOB,
|
|
"datatype_4" BLOB,
|
|
"datatype_5" BLOB
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1818193619424"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1818193619424"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section1818193619424"></a><h4 class="sectiontitle">Set Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_table10307949615" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Set type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_row83071941461"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.7.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p230710412620">MySQL Set Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.3033303330333%" id="mcps1.3.7.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p12307141365">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.36333633363336%" id="mcps1.3.7.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p1030714262"><span id="EN-US_TOPIC_0000001188681004__text87911444100">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_row2307945620"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p9307341361">ENUM</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.3033303330333%" headers="mcps1.3.7.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p9307541619">ENUM</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.36333633363336%" headers="mcps1.3.7.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p43071441662">VARCHAR(14)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_row153085420614"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p4308114562">SET</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.3033303330333%" headers="mcps1.3.7.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p3308841666">SET</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.36333633363336%" headers="mcps1.3.7.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p173083420617">VARCHAR(14)</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p10251501083"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b96071321153212">Input: ENUM</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_screen198514121388">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
id int(2) PRIMARY KEY,
|
|
`dataType_17` ENUM('dws-1', 'dws-2', 'dws-3')
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p203432231188"><strong id="EN-US_TOPIC_0000001188681004__b1413474105">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_screen1871773318816">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"id" INTEGER(2) PRIMARY KEY,
|
|
"datatype_17" VARCHAR(14)
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p996313591480"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b116075210325">Input: SET</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_screen1010119234919">CREATE TABLE IF NOT EXISTS `runoob_tbl_test`(
|
|
`dataType_18` SET('dws-1', 'dws-2', 'dws-3')
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_p14992203111018"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b46071721153218">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164519_screen6915144108">CREATE TABLE "public"."runoob_tbl_test"
|
|
(
|
|
"datatype_18" VARCHAR(14)
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_18");</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1540624204220"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section1540624204220"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section1540624204220"></a><h4 class="sectiontitle">Boolean Types</h4><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164703_p8060118"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b1430244623217">Input: BOOL/BOOLEAN</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164703_screen17940112818193">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` INT,
|
|
`dataType_2` BOOL,
|
|
`dataType_3` BOOLEAN
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164703_p837154111192"><strong id="EN-US_TOPIC_0000001188681004__b614509708">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164703_screen151561253121913">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" INTEGER,
|
|
"datatype_2" BOOLEAN,
|
|
"datatype_3" BOOLEAN
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section14212134405"><a name="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_section14212134405"></a><a name="en-us_topic_0238518439_en-us_topic_0237362176_section14212134405"></a><h4 class="sectiontitle">Binary Types</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_table8357194922719" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Binary type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_row203574498277"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p11357049102713">MySQL Binary Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p1835718492278">MySQL Input</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p535794918273"><span id="EN-US_TOPIC_0000001188681004__text3795194201018">GaussDB(DWS)</span> Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_row5357104942717"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p635754962710">BIT[(M)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p9357104962712">BIT[(M)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p035754932711">BIT[(M)]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_row173575497272"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p53589496271">BINARY[(M)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p135811498275">BINARY[(M)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p1335884913278">BYTEA</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_row14358349102720"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p9358134902713">VARBINARY[(M)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p435811497274">VARBINARY[(M)]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p14358049172711">BYTEA</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p98581946183019"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b5157131419331">Input: BIT</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_screen38077112319">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` INT,
|
|
`dataType_2` BIT(1),
|
|
`dataType_3` BIT(64)
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p15847111219315"><strong id="EN-US_TOPIC_0000001188681004__b1469218405">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_screen1040352415318">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" INTEGER,
|
|
"datatype_2" BIT(1),
|
|
"datatype_3" BIT(64)
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p04417351357"><strong id="EN-US_TOPIC_0000001188681004__en-us_topic_0237712393_b11585146331">Input: [VAR]BINARY</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_screen2261112533610">CREATE TABLE IF NOT EXISTS `runoob_dataType_test`(
|
|
`dataType_1` INT,
|
|
`dataType_2` BINARY,
|
|
`dataType_3` BINARY(0),
|
|
`dataType_4` BINARY(255),
|
|
`dataType_5` VARBINARY(0),
|
|
`dataType_6` VARBINARY(6553)
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_p5150184531611"><strong id="EN-US_TOPIC_0000001188681004__b350277406">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188681004__en-us_topic_0238518439_en-us_topic_0237362176_en-us_topic_0214164624_screen152741325177">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"datatype_1" INTEGER,
|
|
"datatype_2" BYTEA,
|
|
"datatype_3" BYTEA,
|
|
"datatype_4" BYTEA,
|
|
"datatype_5" BYTEA,
|
|
"datatype_6" BYTEA
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype_1");</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_sct_0013.html">MySQL Syntax Migration</a></div>
|
|
</div>
|
|
</div>
|
|
|