Files
doc-exports/docs/dws/tool/DWS_DS_027.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

64 lines
17 KiB
HTML

<a name="EN-US_TOPIC_0000001813598768"></a><a name="EN-US_TOPIC_0000001813598768"></a>
<h1 class="topictitle1">Managing the SQL Query Execution History</h1>
<div id="body1584526252529"><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p35191048">Data Studio allows viewing and managing frequently used SQL queries. The history of executed SQL queries is maintained only for the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b2905617223547">SQL Terminal</strong>.</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol320174758"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li16362779511"><span>On the <strong id="EN-US_TOPIC_0000001813598768__b20143134112313">SQL Terminal</strong> tab page, click <strong id="EN-US_TOPIC_0000001813598768__b337110436231">SQL History.</strong> The <strong id="EN-US_TOPIC_0000001813598768__b9696102922310">SQL History</strong> dialog box is displayed.</span><p><p id="EN-US_TOPIC_0000001813598768__p138902598320"><span><img id="EN-US_TOPIC_0000001813598768__image1260013311956" src="figure/en-us_image_0000001813599184.png" width="492.1" height="80.8108" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000001813598768__p1623843011146"></p>
</p></li></ol>
<div class="note" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_note33979931"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p39948792">SQL history scripts are not encrypted.</p>
</div></div>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p37383929">The number of queries saved in the <strong id="EN-US_TOPIC_0000001813598768__b620935313498">SQL History</strong> dialog box is based on the value defined in <strong id="EN-US_TOPIC_0000001813598768__b120985374913">Preferences &gt; Editor &gt; SQL </strong><strong id="EN-US_TOPIC_0000001813598768__b7209105344917">History</strong> pane. Refer to the <a href="DWS_DS_005.html#EN-US_TOPIC_0000001813438860__table1510418570339">Table 1</a> section to modify the SQL History count. Data Studio overwrites the older queries into the SQL history after the list is full. The executed query is automatically stored in the list.</p>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p32432801134124">The <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b3867312518611">SQL History</strong> dialog box has the following columns:</p>
<ul id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ul911047"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li43916760"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b4586012918114">Pin Status</strong> - Displays the pinned status of the queries. Pinned queries will always show on the top and it will not be deleted from the history even when the list is full.</li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li487831"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b21932360181111">SQL Statement</strong> - Displays the SQL query. The number of characters for an SQL query displayed in the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b1570817018853">SQL Statement</strong> column is based on the number defined in <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b98019566214">Preferences &gt; Editor &gt; SQL </strong><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b4802105610215">History</strong> pane. Refer to the <a href="DWS_DS_005.html#EN-US_TOPIC_0000001813438860__table1510418570339">Table 1</a> section to modify the number of characters for a query.</li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li39514346"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b41299017181117">Number of Records</strong> - Displays the number of records fetched by the SQL query.</li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li46545466"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b13184781181324">Start Time</strong> - Displays the time the query execution was started.</li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li12086382"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b57484040181330">Execution Time</strong> - Displays the time taken to execute the query.</li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li39472879"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b2552962181616">Database Name</strong> - Displays the name of the database.</li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li43186596"><strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b4091068181338">Execution Status</strong> - Displays the execution status of the query as <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b42517832181021">Success</strong> or <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b21392392181021">Failure</strong>.</li></ul>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p8199431">Deleting the connection profile deletes the history. If the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b611426323023">SQL History</strong> dialog box is closed, the query is not removed from the list.</p>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p4696429">You can perform the following operations in the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b467110890557">SQL History</strong> dialog box:</p>
<ul id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ul42267867"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li619814411328"><a href="#EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ref471314809">Loading an SQL Query Into the SQL Terminal</a></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li4297671511342"><a href="#EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section29561677225829">Loading Multiple SQL Queries Into the SQL Terminal</a></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li587321941141"><a href="#EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section41363205225852">Deleting an SQL Query</a></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li1734002611414"><a href="#EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section3787436422590">Deleting all SQL Queries</a></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li4695545211423"><a href="#EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ref471314785">Pinning an SQL Query</a></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li6023740211431"><a href="#EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section62690964225923">Unpinning an SQL Query</a></li></ul>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ref471314809"><a name="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ref471314809"></a><a name="en-us_topic_0185264358_ref471314809"></a><h4 class="sectiontitle">Loading an SQL Query Into the SQL Terminal</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p29602433">Follow the steps to load the SQL query into the SQL terminal:</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol48986840"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li38228382"><span>Select the required query and click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image257215750433" src="figure/en-us_image_0000001860319669.jpg" height="24.9375" width="22.942500000000003" title="Click to enlarge" class="imgResize"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p9491260">The query is appended to the cursor position in the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b2309203604341">SQL Terminal</strong>.</p>
</p></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section29561677225829"><a name="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section29561677225829"></a><a name="en-us_topic_0185264358_section29561677225829"></a><h4 class="sectiontitle">Loading Multiple SQL Queries Into the SQL Terminal</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p6915674">The <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b1857705004812">Load in SQL</strong> <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b14240444154012">Terminal and close History</strong> button loads selected queries into the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b521702904145">SQL Terminal</strong> and closes the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b6612224904215">SQL History</strong> dialog box.</p>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p8149778">Follow the steps to load selected SQL queries into the SQL terminal:</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol56152285"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li35608518"><span>Select the required queries.</span></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li52041212"><span>Click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image4769516904921" src="figure/en-us_image_0000001813599736.jpg" height="20.9475" width="20.9475" title="Click to enlarge" class="imgResize"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p54588632">The queries are appended to the cursor position in the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b511614260490">SQL Terminal</strong>.</p>
</p></li></ol>
<div class="note" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_note6922452132615"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p1315255491312">If you continue the execution on error, then each statement in the terminal will be running as a scheduled job and runs one after the other. The execution status is updated on the console and job progress is displayed. When the time difference between Job Execution, Progress Bar Update and Console Update is very minimal, you will not be able to open the progress bar and stop the execution. In such scenarios you have to close the SQL terminal to the terminate execution.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section132578461665"><h4 class="sectiontitle">Loading More Records</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p117083321084">Regarding to load more data of result tab, you have to scroll down to bottom in order to load more data, which is inconvenient in some use cases. Currently, DS supports a loading more record button which makes it easier to trigger the loading more data action.</p>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p11121122718117">Follow the steps to load more records</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol12211450131519"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li942519214815"><span>Select the required queries and click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image122211313282" src="figure/en-us_image_0000001813439396.png"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p144010144274">List all the required records.</p>
</p></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section41363205225852"><a name="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section41363205225852"></a><a name="en-us_topic_0185264358_section41363205225852"></a><h4 class="sectiontitle">Deleting an SQL Query</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p66665241">Follow the steps to delete a SQL query from the SQL history list:</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol31175435"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li12143461"><span>Select the required query and click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image3293713805028" src="figure/en-us_image_0000001813599732.jpg" height="23.94" width="18.9525" title="Click to enlarge" class="imgResize"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p44096323">A confirmation pop up window is displayed.</p>
</p></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li61322592"><span>Click <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b30641655154726">OK</strong>.</span></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section3787436422590"><a name="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section3787436422590"></a><a name="en-us_topic_0185264358_section3787436422590"></a><h4 class="sectiontitle">Deleting all SQL Queries</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p9666612">Follow the steps to delete all SQL queries from the SQL History list:</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol44798103"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li529748"><span>Click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image4662572805130" src="figure/en-us_image_0000001860199813.jpg" height="23.94" width="20.9475" title="Click to enlarge" class="imgResize"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p42909617">A confirmation pop up window is displayed.</p>
</p></li><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li50642235"><span>Click <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b3573786154721">OK</strong>.</span></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ref471314785"><a name="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ref471314785"></a><a name="en-us_topic_0185264358_ref471314785"></a><h4 class="sectiontitle">Pinning an SQL Query</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p8314412">You can pin queries that you do not want Data Studio to delete automatically from the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b5461759923814">SQL History</strong>. You can pin a maximum of 50 queries. Pinned queries are displayed at the top of the list. The value set in SQL history count does not affect the pinned queries. Refer to <a href="DWS_DS_005.html#EN-US_TOPIC_0000001813438860__table1510418570339">Table 1</a> for additional information on SQL history count.</p>
<div class="note" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_note2378778"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p21409010">The pinned queries appear on top once the <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b5618646916313_1">SQL History</strong> window is closed and re-opened.</p>
</div></div>
<p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p5668011">Follow the steps to pin a SQL query:</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol51012105"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li56455762"><span>Select the required SQL query and click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image5678459021288" src="figure/en-us_image_0000001813439956.jpg" height="17.955000000000002" width="18.9525" title="Click to enlarge" class="imgResize"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p9514038">The <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b368082305310">Pin Status</strong> column displays the pinned status of the query.</p>
</p></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section62690964225923"><a name="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_section62690964225923"></a><a name="en-us_topic_0185264358_section62690964225923"></a><h4 class="sectiontitle">Unpinning an SQL Query</h4><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p23521075">Follow the steps to unpin a SQL query:</p>
<ol id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_ol10363091"><li id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_li26158957"><span>Select the required SQL query and click <span><img id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_image48456866212823" src="figure/en-us_image_0000001813439952.jpg" height="17.955000000000002" width="18.9525" title="Click to enlarge" class="imgResize"></span>.</span><p><p id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_p38500800">The <strong id="EN-US_TOPIC_0000001813598768__en-us_topic_0185264358_b2760088705316">Pin Status</strong> column displays the unpinned status of the query.</p>
</p></li></ol>
</div>
</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>