forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
45 lines
5.3 KiB
HTML
45 lines
5.3 KiB
HTML
<a name="mrs_01_1440"></a><a name="mrs_01_1440"></a>
|
|
|
|
<h1 class="topictitle1">DELETE RECORDS from CARBON TABLE</h1>
|
|
<div id="body1595920213048"><div class="section" id="mrs_01_1440__se3b246829d4149768297e4d1c472eeab"><h4 class="sectiontitle">Function</h4><p id="mrs_01_1440__a8adcf45335aa490b90f435984dbe1cbe">This command is used to delete records from a CarbonData table.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1440__s1671eb7942fc4963bdf01350bb3fa47f"><h4 class="sectiontitle">Syntax</h4><p id="mrs_01_1440__a499f126051a649fd81f89aafebdb658e"><b><span class="cmdname" id="mrs_01_1440__cmdname7202142791718">DELETE FROM CARBON_TABLE [WHERE expression];</span></b></p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1440__se8c89a51ff704cbf8568c24dab46efb1"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1440__t4fe72c117c47406da504174f64aa1549" frame="border" border="1" rules="all"><caption><b>Table 1 </b>DELETE RECORDS parameters</caption><thead align="left"><tr id="mrs_01_1440__r88ce278ab29947e9a817bb019e1322ef"><th align="left" class="cellrowborder" valign="top" width="23.68%" id="mcps1.3.3.2.2.3.1.1"><p id="mrs_01_1440__a16956298285c4692affaac5242b12032">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="76.32%" id="mcps1.3.3.2.2.3.1.2"><p id="mrs_01_1440__aaab8b5e3259f49988eabaa067b4aae3a">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_1440__r5bb5a24bf8e5448e8ff37c26fe720684"><td class="cellrowborder" valign="top" width="23.68%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_1440__a704fefb2f0924b5aa5fe933b5dedadd5">CARBON TABLE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.32%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_1440__a45f6c012ef244869bc9073b46cbeb907">Name of the CarbonData table in which the DELETE operation is performed</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_1440__sb57a6f45983745bc9d90e11c1dffc7d8"><h4 class="sectiontitle">Precautions</h4><ul id="mrs_01_1440__u86ff5ab10920453285c221e5b39f246d"><li id="mrs_01_1440__l93201527eb4b48ebb682d07e823a670c">If a segment is deleted, all secondary indexes associated with the segment are deleted as well.</li><li id="mrs_01_1440__l6760c8cea4034f99882d5078ab51fb86">If the <strong id="mrs_01_1440__b17811438135">carbon.input.segments</strong> property has been set for the queried table, the DELETE operation fails. To solve this problem, run the following statement before the query:<p id="mrs_01_1440__a54328eceada74c2797e53b16effcc60f">Syntax:</p>
|
|
<p id="mrs_01_1440__a90f1d66a1ea94058a71a5df8b888f560"><strong id="mrs_01_1440__a6b930c65b4494e4ca04671b65c565021">SET carbon.input.segments. <database_name>.<table_name>=*;</strong></p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_1440__sf2d9a80e0de7460491ccd7ee39a7aa01"><h4 class="sectiontitle">Examples</h4><ul id="mrs_01_1440__ufb19c81351334a25b726a85292cb3e40"><li id="mrs_01_1440__lc13110809af04b36ad53274a35007628">Example 1:<p id="mrs_01_1440__a90f3f98406b9401ead42bf0ce076a508"><a name="mrs_01_1440__lc13110809af04b36ad53274a35007628"></a><a name="lc13110809af04b36ad53274a35007628"></a><b><span class="cmdname" id="mrs_01_1440__cmdname628713210174">delete from columncarbonTable1 d where d.column1 = 'country';</span></b></p>
|
|
</li><li id="mrs_01_1440__l154f85221d0b4004ac9615e9cfe2bcf9">Example 2:<p id="mrs_01_1440__a780d2c03c3a3498080276d006f89b9f9"><a name="mrs_01_1440__l154f85221d0b4004ac9615e9cfe2bcf9"></a><a name="l154f85221d0b4004ac9615e9cfe2bcf9"></a><b><span class="cmdname" id="mrs_01_1440__cmdname542193771718">delete from dest where column1 IN ('country1', 'country2');</span></b></p>
|
|
</li><li id="mrs_01_1440__lf7278378393f48cc952a2f478817151c">Example 3:<p id="mrs_01_1440__af0f3fa5d9cd5448494594b4b9bcd4298"><a name="mrs_01_1440__lf7278378393f48cc952a2f478817151c"></a><a name="lf7278378393f48cc952a2f478817151c"></a><b><span class="cmdname" id="mrs_01_1440__cmdname10946114016176">delete from columncarbonTable1 where column1 IN (select column11 from sourceTable2);</span></b></p>
|
|
</li><li id="mrs_01_1440__leee0e228547d4f3f82b4857d4f669e84">Example 4:<p id="mrs_01_1440__a8235fd6f06a54b9fb04f9f319aabba58"><a name="mrs_01_1440__leee0e228547d4f3f82b4857d4f669e84"></a><a name="leee0e228547d4f3f82b4857d4f669e84"></a><b><span class="cmdname" id="mrs_01_1440__cmdname10513154431718">delete from columncarbonTable1 where column1 IN (select column11 from sourceTable2 where column1 = 'USA');</span></b></p>
|
|
</li><li id="mrs_01_1440__l8025e9664b134c37904731a9e45ce108">Example 5:<p id="mrs_01_1440__ab98fc407691948b5aa9b4d0186429b71"><a name="mrs_01_1440__l8025e9664b134c37904731a9e45ce108"></a><a name="l8025e9664b134c37904731a9e45ce108"></a><b><span class="cmdname" id="mrs_01_1440__cmdname14170482178">delete from columncarbonTable1 where column2 >= 4;</span></b></p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_1440__s823f2687a8cc4162854ad8fcaa12a93a"><h4 class="sectiontitle">System Response</h4><p id="mrs_01_1440__a19642f6cad0c4884a78f569abd795022">Success or failure will be recorded in the driver log and on the client.</p>
|
|
</div>
|
|
<p id="mrs_01_1440__abe3264df16d9476099937bdfb639d8f0"></p>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1437.html">DML</a></div>
|
|
</div>
|
|
</div>
|
|
|