doc-exports/docs/dws/tool/dws_07_6841.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
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>
2023-08-28 09:20:17 +00:00

377 lines
29 KiB
HTML

<a name="EN-US_TOPIC_0000001188202540"></a><a name="EN-US_TOPIC_0000001188202540"></a>
<h1 class="topictitle1">Tables</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section1695112302553"><h4 class="sectiontitle">GaussDB Keyword</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p18274231135513">If a keyword is used as a column name, quotes (") must be added, for example, "order".</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table11955130145511" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row127513185519"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p92751131125517"><strong id="EN-US_TOPIC_0000001188202540__en-us_topic_0237712488_b197121021133820">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p4275173114557"><strong id="EN-US_TOPIC_0000001188202540__en-us_topic_0237712488_b17846121823012">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row16275173185516"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen527517316554">CREATE TABLE tbl_bd2
(
ORDER NUMBER(10),
USER varchar2(30),
DATE VARCHAR(10
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen827519318554">CREATE TABLE tbl_bd2
(
"ORDER" NUMBER(10),
"USER" varchar2(30),
"DATE" VARCHAR(10
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section169726306551"><h4 class="sectiontitle">Data Type (I)</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p18275193185517">LONG VARCHAR should be changed to CLOB.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table10973183005512" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row127518312551"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p82751315551"><strong id="EN-US_TOPIC_0000001188202540__en-us_topic_0237712488_b10426164115429">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1275173155513"><strong id="EN-US_TOPIC_0000001188202540__en-us_topic_0237712488_b5374523203013">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row112752317559"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen727512315556">CREATE TABLE tbl_db2
(
ID VARCHAR(36),
NAME LONG VARCHAR
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1127633115517">CREATE TABLE tbl_db2
(
ID VARCHAR(36),
NAME CLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p202766316556">LONG VARGRAPHIC.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table17983163045513" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row1727683112558"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p152761314557"><strong id="EN-US_TOPIC_0000001188202540__en-us_topic_0237712488_b15250155916421">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1327673135517"><strong id="EN-US_TOPIC_0000001188202540__b775284804">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row18276193113551"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen4276103114553">CREATE TABLE tbl_db2
(
ID VARCHAR(36),
NAME LONG VARGRAPHIC
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen227653114553">CREATE TABLE tbl_db2
(
ID VARCHAR(36),
NAME CLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section699273017551"><h4 class="sectiontitle">Foreign Key</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p8276631195518">Below attributes of Foreign key constraint should be commented:</p>
<ul id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_ul1027612314558"><li id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_li6276731175519">ON UPDATE RESTRICT</li><li id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_li927683117551">ENFORCED</li><li id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_li132766312556">ENABLE QUERY OPTIMIZATION
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table499693012557" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row427612310557"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.3.1.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p10276113117551"><strong id="EN-US_TOPIC_0000001188202540__b65191640124017">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.3.1.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p12768311555"><strong id="EN-US_TOPIC_0000001188202540__b206931046204019">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row192763317559"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.3.1.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen2276431135520">ALTER TABLE "SCH"."TBL_DB2"
ADD CONSTRAINT "Const_Name" FOREIGN KEY("ID")
REFRENCES "SCH"."TBL_DB2_1"("ID")
ON DELETE CASCADE
ON UPDATE RESTRICT
ENFORCED
ENABLE QUERY OPTIMIZATION;</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.3.1.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen5277203118558">ALTER TABLE "SCH"."TBL_DB2"
ADD CONSTRAINT "Const_Name" FOREIGN KEY("ID")
REFRENCES "SCH"."TBL_DB2_1"("ID")
ON DELETE CASCADE
/*ON UPDATE RESTRICT
ENFORCED
ENABLE QUERY OPTIMIZATION*/;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section166103145513"><h4 class="sectiontitle">Sequence</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p6277173135511">built-in auto-increment function.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table46113135511" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row1527719311559"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1727743116551"><strong id="EN-US_TOPIC_0000001188202540__en-us_topic_0237712488_b1017212444475">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p82771531125510"><strong id="EN-US_TOPIC_0000001188202540__b262249387">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row6277331165515"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1127733175514">CREATE TABLE tbl_db2
(
ID BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (
START WITH +1
INCREMENT BY +1
MINVALUE +1
MAXVALUE +9223372036854775807
NO CYCLE
CACHE 20
NO ORDER ) ,
NAME VARCHAR2(50),
ORDER VARCHAR2(100)
);
</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen14277203175510">CREATE SEQUENCE mseq_tbl_db2_id
START WITH +1
INCREMENT BY +1
MINVALUE +1
MAXVALUE +9223372036854775807
NOCYCLE
CACHE 20
NOORDER;
CREATE TABLE tbl_db2
(
ID BIGINT NOT NULL DEFAULT mseq_tbl_db2_id.NEXTVAL,
NAME VARCHAR2(50),
"ORDER" VARCHAR2(100)
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section1822153195517"><h4 class="sectiontitle">Tablespace</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p32771531205513">TABLESPACE for a table to be placed is specified with IN clause.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table42203119553" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row5277193114553"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p13278123155517"><strong id="EN-US_TOPIC_0000001188202540__b2124105394">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p142781431115513"><strong id="EN-US_TOPIC_0000001188202540__b1499616449">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row8278173114550"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1627873185513">CREATE TABLE tbl_db2
(
ID number(20) NOT NULL DEFAULT IDENTITY.NEXTVAL,
NAME VARCHAR2(50)
)
IN tbs1 ; </pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1278831195513">CREATE TABLE tbl_db2
(
ID number(20) NOT NULL DEFAULT IDENTITY.NEXTVAL,
NAME VARCHAR2(50)
)
TABLESPACE tbs1 ; </pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section19313312559"><h4 class="sectiontitle">Default</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p52788319551">WITH DEFAULT is specified to specified DEFAULT value.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table132931185517" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row527813314559"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1278133115557"><strong id="EN-US_TOPIC_0000001188202540__b1970289176">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p20278143112559"><strong id="EN-US_TOPIC_0000001188202540__b815469940">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row13278133115517"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1727803195514">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
STATUS CHAR(1) WITH DEFAULT '0'
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen02781131205519">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
STATUS CHAR(1) DEFAULT '0'
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1527814319551">DEFAULT specified without value.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table948153155519" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row1027953119556"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.10.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1527903145519"><strong id="EN-US_TOPIC_0000001188202540__b1888063710">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.10.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p32795319551"><strong id="EN-US_TOPIC_0000001188202540__b1043969337">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row1627943145518"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.10.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1827918317551">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
STATUS CHAR(1) WITH DEFAULT
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.10.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1027943116552">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
STATUS CHAR(1)
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section1758931185511"><h4 class="sectiontitle">Data Type (II)</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p827915318553">CLOB(1048576)</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table195963110558" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row192794319551"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.11.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p42791731105519"><strong id="EN-US_TOPIC_0000001188202540__b1411194045">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.11.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p9279831185515"><strong id="EN-US_TOPIC_0000001188202540__b1508900764">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row927913316558"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1127917316551">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
REMARKS CLOB(1048576));</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen2279231145514">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
REMARKS CLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p2027993119552">BLOB(2048000)</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table5689314553" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row1279173113559"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.13.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p172792313559"><strong id="EN-US_TOPIC_0000001188202540__b100123957">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.13.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p132802031135516"><strong id="EN-US_TOPIC_0000001188202540__b1254911123">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row14280143118551"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.13.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen528053195514">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
REMARKS BLOB(2048000)
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.13.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen9280131185513">CREATE TABLE tbl_db2
(
ID number(20) ,
NAME VARCHAR2(50),
REMARKS BLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section14761331135516"><h4 class="sectiontitle">LOB Options</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p19280143116559">LOGGED/UNLOGGED</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table18771531145513" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row19280193145515"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.14.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p5280031155513"><strong id="EN-US_TOPIC_0000001188202540__b1319318763">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.14.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1928012317552"><strong id="EN-US_TOPIC_0000001188202540__b1668227005">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row328033112557"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.14.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen16280133116556">CREATE TABLE tbl_db2
(
"ID" number(20) ,
"NAME" VARCHAR2(50),
"REMARKS" BLOB LOGGED
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.14.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen328023111557">CREATE TABLE tbl_db2
(
"ID" number(20) ,
"NAME" VARCHAR2(50),
"REMARKS" BLOB /*LOGGED */
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p142801931165515">COMPACT/NOT COMPACT</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table68643115558" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row172801031155515"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.16.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p11280193112553"><strong id="EN-US_TOPIC_0000001188202540__b485568793">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.16.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p1828043113559"><strong id="EN-US_TOPIC_0000001188202540__b1818173345">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row15280153110552"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen3280431165517">CREATE TABLE tbl_db2
(
"ID" number(20) ,
"NAME" VARCHAR2(50),
"REMARKS" BLOB LOGGED NOT COMPACT
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1028112317553">CREATE TABLE tbl_db2
(
"ID" number(20) ,
"NAME" VARCHAR2(50),
"REMARKS" BLOB /*LOGGED */ /* NOT COMPACT*/
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_section189433116552"><h4 class="sectiontitle">Organize By</h4><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p2281131155510">Organize By</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_table129583119553" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row32811831175515"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.17.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p328103110559"><strong id="EN-US_TOPIC_0000001188202540__b1634778869">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.17.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_p192819313559"><strong id="EN-US_TOPIC_0000001188202540__b1367024233">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_row19281143119554"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.17.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen1828113111553">CREATE TABLE tbl_db2
(
"ID" number(20) ,
"NAME" VARCHAR2(50),
"REMARKS" BLOB
)
IN tbs1
ORGANIZE BY ("ID","NAME");</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.17.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202540__en-us_topic_0238518454_en-us_topic_0237362206_en-us_topic_0213529182_screen22819318554">CREATE TABLE tbl_db2
(
"ID" number(20) ,
"NAME" VARCHAR2(50),
"REMARKS" BLOB
)
TABLESPACE tbs1
/*ORGANIZE BY ("ID","NAME")*/;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_07_0684.html">DB2 Syntax Migration</a></div>
</div>
</div>