Files
doc-exports/docs/dws/tool/DWS_DS_032.html
luhuayi a5e3903f6b DWS TG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-04-23 13:53:01 +00:00

45 lines
8.1 KiB
HTML

<a name="EN-US_TOPIC_0000001860318781"></a><a name="EN-US_TOPIC_0000001860318781"></a>
<h1 class="topictitle1">Selecting a DB Object in the SQL Terminal</h1>
<div id="body1584526252530"><p id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p19553210">Data Studio suggests a list of possible schema names, table names and column names, and views in the SQL Terminal.</p>
<p id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p41761167">Follow the steps below to select a DB object:</p>
<ol id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_ol40306186"><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li24130231"><span>Press <strong id="EN-US_TOPIC_0000001860318781__b14728662998138">Ctrl</strong> and <strong id="EN-US_TOPIC_0000001860318781__b15114111918138">Space</strong> and enter the required parent DB object name. The DB objects list is refined as you continue typing the DB object name. The DB objects list displays all DB objects of the database connected to the SQL Terminal.</span><p><p id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p71605212577"><span><img id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_image191598217577" src="figure/en-us_image_0000001860199285.jpg" width="399" height="257.470976" title="Click to enlarge" class="imgResize"></span></p>
</p></li><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li10644124"><span>To select the parent DB object, use the <strong id="EN-US_TOPIC_0000001860318781__b19728744144411">Up</strong> or <strong id="EN-US_TOPIC_0000001860318781__b1643447144413">Down</strong> arrow keys and press <strong id="EN-US_TOPIC_0000001860318781__b19169050114415">Enter</strong> on the keyboard, or double-click the parent DB object.</span></li><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li28688252"><span>Press <strong id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_b56867678">.</strong> to list all child DB objects.</span><p><p id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p61001017155716"><span><img id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_image3100141719575" src="figure/en-us_image_0000001860319125.jpg" height="231.04001900000003" width="399" title="Click to enlarge" class="imgResize"></span></p>
</p></li><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li50368676"><span>To select the child DB object, use the <strong id="EN-US_TOPIC_0000001860318781__b1029118312459">Up</strong> or <strong id="EN-US_TOPIC_0000001860318781__b188672033164518">Down</strong> arrow keys and press <strong id="EN-US_TOPIC_0000001860318781__b1086723613451">Enter</strong> on the keyboard, or double-click the child DB object.</span><p><p id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p50664905">On selection, the child DB object will be appended to the parent DB object (with a period '.').</p>
<div class="note" id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_note53330965"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_ul798811152118"><li class="text" id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li3656632316">Auto-suggest also works on keywords, data types, schema names, table names, views, and table name aliases in the same way as shown above for all schema objects that you have access.<p class="text" id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p1523103664317"><a name="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li3656632316"></a><a name="en-us_topic_0185264718_li3656632316"></a>Following is a sample query with alias objects:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_screen162320369430"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span>
<span class="w"> </span><span class="n">table_alias</span><span class="p">.</span><span class="o">&lt;</span><span class="n">auto</span><span class="o">-</span><span class="n">suggest</span><span class="o">&gt;</span>
<span class="k">FROM</span><span class="w"> </span><span class="n">test</span><span class="p">.</span><span class="n">t1</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">table_alias</span>
<span class="w"> </span><span class="k">WHERE</span>
<span class="w"> </span><span class="n">table_alias</span><span class="p">.</span><span class="o">&lt;</span><span class="n">auto</span><span class="o">-</span><span class="n">suggest</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span>
<span class="k">GROUP</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">table_alias</span><span class="p">.</span><span class="o">&lt;</span><span class="n">auto</span><span class="o">-</span><span class="n">suggest</span><span class="o">&gt;</span>
<span class="k">HAVING</span><span class="w"> </span><span class="n">table_alias</span><span class="p">.</span><span class="o">&lt;</span><span class="n">auto</span><span class="o">-</span><span class="n">suggest</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span>
<span class="k">ORDER</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="k">table</span><span class="w"> </span><span class="k">alias</span><span class="p">.</span><span class="o">&lt;</span><span class="n">auto</span><span class="o">-</span><span class="n">suggest</span><span class="o">&gt;</span>
</pre></div></td></tr></table></div>
</div>
</li><li class="text" id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li7280126162110">A loading message may be displayed on the <strong id="EN-US_TOPIC_0000001860318781__b1614115385811">SQL Terminal</strong> in the following scenarios:<ul id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_ul1937917819582"><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li238068135811">The object is not loaded due to the value mentioned in the <strong id="EN-US_TOPIC_0000001860318781__b10309511124719">Load Limit</strong> field. For details, see <a href="DWS_DS_005.html#EN-US_TOPIC_0000001813438860__table1510418570339">Table 1</a>.</li><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li1538516855811">The objects that are already added to <strong id="EN-US_TOPIC_0000001860318781__b9724920588139">Exclude</strong> will not be loaded. For details, see <a href="DWS_DS_005.html#EN-US_TOPIC_0000001813438860__table1510418570339">Table 1</a>.</li><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li19392881584">There is a delay in fetching the object from the server.</li></ul>
</li><li id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li1616619247196">If there are objects with the same name in different case, then auto-suggest will display child objects of both parent objects.<p id="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_p2583101083917"><a name="EN-US_TOPIC_0000001860318781__en-us_topic_0185264718_li1616619247196"></a><a name="en-us_topic_0185264718_li1616619247196"></a>Example: If there are two schemas with the name <strong id="EN-US_TOPIC_0000001860318781__b18842105845814">public</strong> and <strong id="EN-US_TOPIC_0000001860318781__b1984213585589">PUBLIC</strong>, then all child objects for both these schemas will be displayed.</p>
</li></ul>
</div></div>
</p></li></ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="DWS_DS_025.html">SQL Terminal Management</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>