doc-exports/docs/ddm/umn/ddm_03_0040.html
Ru, Li Yi 4b09a03a51 ddm_umn
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-04-11 11:39:26 +00:00

19 lines
1.4 KiB
HTML

<a name="ddm_03_0040"></a><a name="ddm_03_0040"></a>
<h1 class="topictitle1">Specifying a Shard Using a Hint When Executing a SQL Statement</h1>
<div id="body0000001272821437"><p id="ddm_03_0040__p8060118"><strong id="ddm_03_0040__b287294915285">Command Format:</strong></p>
<pre class="codeblock" id="ddm_03_0040__codeblock1553144121610">/*+db=&lt;physical_db_name&gt;*/ &lt;your query&gt;;</pre>
<p id="ddm_03_0040__p10800132161520"><strong id="ddm_03_0040__b538920548286">Description:</strong></p>
<p id="ddm_03_0040__p4641081162">Specify a shard by configuring <em id="ddm_03_0040__i105891639192918">&lt;physical_db_name&gt;</em> and execute a SQL statement on the shard.</p>
<p id="ddm_03_0040__p2650132351620"><strong id="ddm_03_0040__b18141134173020">Example:</strong></p>
<pre class="codeblock" id="ddm_03_0040__codeblock167620214189">/*+db=test_0000*/ select * from t1;</pre>
<p id="ddm_03_0040__p031691591814"><strong id="ddm_03_0040__b97427719309">Restrictions:</strong></p>
<ul id="ddm_03_0040__ul6101201603517"><li id="ddm_03_0040__li17101816103512">The hint is valid only for SELECT, DML, and TRUNCATE statements.</li><li id="ddm_03_0040__li31011169351">The hint works only under the text protocol, rather than the Prepare protocol.</li></ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ddm_08_0002.html">Supported SQL Statements</a></div>
</div>
</div>