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

53 lines
5.9 KiB
HTML

<a name="dli_08_0090"></a><a name="dli_08_0090"></a>
<h1 class="topictitle1">Viewing All Tables</h1>
<div id="body8662426"><div class="section" id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_sdeda08593ee34e12b4debbfca8a0866a"><h4 class="sectiontitle">Function</h4><p id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_ac07daa5608984cc783a4f1b974b51280">This statement is used to view all tables and views in the current database.</p>
</div>
<div class="section" id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_s541a06951df34fc8905547a4003fcdb1"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="dli_08_0090__en-us_topic_0114776184_screen2973164611294"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SHOW</span><span class="w"> </span><span class="n">TABLES</span><span class="w"> </span><span class="p">[</span><span class="k">IN</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">db_name</span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="k">LIKE</span><span class="w"> </span><span class="n">regex_expression</span><span class="p">];</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_sdf1ef8747be646598ba872d8a8c29bdb"><h4 class="sectiontitle">Keywords</h4><p id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_ab0c5a0492410453b8a94875cab94396a">FROM/IN: followed by the name of a database whose tables and views will be displayed.</p>
</div>
<div class="section" id="dli_08_0090__en-us_topic_0114776170_section1130610201331"><h4 class="sectiontitle">Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0090__en-us_topic_0114776170_table137579239220" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="dli_08_0090__en-us_topic_0114776170_row17564232219"><th align="left" class="cellrowborder" valign="top" width="19.009999999999998%" id="mcps1.3.4.2.2.3.1.1"><p id="dli_08_0090__en-us_topic_0114776170_p3756152318220">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80.99%" id="mcps1.3.4.2.2.3.1.2"><p id="dli_08_0090__en-us_topic_0114776170_p167561023629">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0090__en-us_topic_0114776170_row1375611231219"><td class="cellrowborder" valign="top" width="19.009999999999998%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0090__en-us_topic_0114776170_p107564232216">db_name</p>
</td>
<td class="cellrowborder" valign="top" width="80.99%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0090__en-us_topic_0114776170_p1575614231121">Database name, which consists of letters, digits, and underscores (_). The value cannot contain only digits or start with a digit or underscore (_).</p>
</td>
</tr>
<tr id="dli_08_0090__en-us_topic_0114776170_row117571623729"><td class="cellrowborder" valign="top" width="19.009999999999998%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0090__en-us_topic_0114776170_p87577239219">regex_expression</p>
</td>
<td class="cellrowborder" valign="top" width="80.99%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0090__en-us_topic_0114776170_p675715235211">Name of a database table.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_saa43efd29d6d4d16b9b80e4a0fb3aa17"><h4 class="sectiontitle">Precautions</h4><p id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_en-us_topic_0047959922_p381740216546">None</p>
</div>
<div class="section" id="dli_08_0090__en-us_topic_0114776184_en-us_topic_0093946872_s130e213e29c04a38b9e45e22235618b1"><h4 class="sectiontitle">Example</h4><ol id="dli_08_0090__ol1848075010256"><li id="dli_08_0090__li329102719205">Create a table. For details, see <a href="dli_08_0223.html">Creating an OBS Table</a> or <a href="dli_08_0224.html">Creating a DLI Table</a>.</li><li id="dli_08_0090__li692017217263">To show all tables and views in the current database, run the following statement:<div class="codecoloring" codetype="Sql" id="dli_08_0090__en-us_topic_0114776184_screen1733351113309"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SHOW</span><span class="w"> </span><span class="n">TABLES</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</li><li id="dli_08_0090__li15703342172617">To show all tables started with <strong id="dli_08_0090__en-us_topic_0107972086_en-us_topic_0093946872_b84235270615359">test</strong> in the <strong id="dli_08_0090__en-us_topic_0107972086_en-us_topic_0093946872_b842352706153545">testdb</strong> database, run the following statement:<div class="codecoloring" codetype="Sql" id="dli_08_0090__en-us_topic_0114776184_screen795262463011"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SHOW</span><span class="w"> </span><span class="n">TABLES</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="n">testdb</span><span class="w"> </span><span class="k">LIKE</span><span class="w"> </span><span class="ss">&quot;test*&quot;</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0089.html">Viewing Tables</a></div>
</div>
</div>