forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
39 lines
10 KiB
HTML
39 lines
10 KiB
HTML
<a name="EN-US_TOPIC_0000001188521062"></a><a name="EN-US_TOPIC_0000001188521062"></a>
|
|
|
|
<h1 class="topictitle1">Opening and Saving SQL Scripts</h1>
|
|
<div id="body32001227"><div class="section" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_section171361011182215"><h4 class="sectiontitle">Opening an SQL Script</h4><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p3942429">Follow the steps to open an SQL script:</p>
|
|
</div>
|
|
<ol id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ol35481869"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li1814025993618"><span>Choose <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b086125724812">File > Open </strong>from the main menu. Alternatively, click <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b186175711485">Open</strong> on the toolbar or right-click the <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b17862175711488">SQL Terminal</strong> and select <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b168641757134820">Open</strong>.</span><p><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p17382100173719">If the SQL Terminal has existing content, then there will be an option to overwrite the existing content or append content to it.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li32875415369"><span>The <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b198661757104812">Open</strong> dialog box is displayed.</span></li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li2417790911166"><span><strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b5870857174820"></strong>In <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b5870757104817">Open</strong> dialog box, select the SQL file to import and click <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b18870175717482">Open</strong>.</span><p><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p89511710163619">The selected SQL script is opened as a <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b1587265734810">File Terminal.</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p110110490293">The icons on the file terminal tab is different from those in the SQL terminal. When you move the mouse cursor over the source file, corresponding database connection will be displayed on File Terminal.</p>
|
|
</p></li></ol>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_note1210542312499"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ul95902419599"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li1959015419591">The encoding type of the SQL file must match the encoding type specified in <a href="DWS_DS_141.html#EN-US_TOPIC_0000001188202558__en-us_topic_0185264923_li1083312422094">preferences</a>.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li85907410591">Label of the file terminal will start with asterisk(*) if any of its content is edited. Dirty flag is removed once the file terminal is saved.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li76788246339">File Terminals cannot be renamed. One terminal is always mapped to one Source Script File, but one script can be opened in multiple terminals.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li9130123418261">You can open SQL scripts only on SQL Terminals.</li></ul>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p179381431153513">Data Studio allows you to save and open SQL scripts in the <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b28634348142943">SQL Terminal</strong>. After saving the changes, SQL Terminal will be changed to a File Terminal.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_section6440164084417"><h4 class="sectiontitle">Saving an SQL Script</h4><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p17509173264212">The <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b164061036378">Save</strong> option saves the File Terminal content to the associated file. ,</p>
|
|
<p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p46107371">Follow the steps to save an SQL script:</p>
|
|
<ol id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ol12313157"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li168515402033"><span>Perform any of the following operations:</span><p><ul id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ul1516835410916"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li161681154393">Choose <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b7706111715397">File > Save </strong>from the main menu.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li4168854099">Press "Ctrl + S" to save the SQL terminal content.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li41699541197">Click <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b193029483393">Save</strong> on the toolbar or right-click the <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b6302148193918">SQL Terminal</strong> and select <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b113021248103916">Save</strong>.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p611811521236">The <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b28901956194214">Data Studio Security Disclaimer</strong> dialog box is displayed.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li15691113193117"><span>Click <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b588981711436">OK</strong>.</span><p><div class="p" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p6474161684819">Data Studio displays the status of the operation in the status bar<strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b266644134416"></strong>.<div class="note" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_note1066764812819"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ul550571515481"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li175058158487">The script is saved as an SQL file. Data Studio sets the read/write permission for the saved SQL file. To ensure security, you must set the read/write permissions for folders.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li1950581511481">When a change is made in a file and if that associated file is unavailable, it will trigger the <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b363083212377">Save As </strong>option.<ul id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ul728517146557"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li1510553175318">In any case, if saving of the source file is failed due to some reasons, then user is prompted with the <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b198917513817">Save As</strong> option to save the content as a new source file. If you choose not to save (that is cancelling <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b0656123763818">Save As</strong>), then File Terminal gets converted into an SQL Terminal.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li232216118208">The changes made to File Terminals are not Auto Saved.</li></ul>
|
|
</li></ul>
|
|
</div></div>
|
|
</div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_section1197648113310"><h4 class="sectiontitle">Saving an SQL Script in New File</h4><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p137202513338">The <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b1132184493913">Save As </strong>option saves the terminal content to a new file.</p>
|
|
<p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p1993285913217">Follow the steps to save an SQL script:</p>
|
|
<ol id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ol8705141910340"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li158971953219"><span>Perform any of the following operations:</span><p><ul id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_ul84816317220"><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li15481739223">Choose <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b8611192842111">File > Save As </strong>from the main menu.</li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li10489314227">Alternatively click "Ctrl + Alt + S key to save SQL terminal or File terminal content in new file.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p913794712236">The <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b181581443164515">Data Studio Security Disclaimer</strong> dialog box is displayed.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li3556105515343"><span>Click <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b1371920568540">OK</strong>.</span><p><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p576012462508">The <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b319110915514">Save As</strong> dialog box is displayed.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_li85989579223"><span>Select the location to save the script and click <strong id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_b131620436451">Save</strong>.</span></li></ol>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_note135562400221"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188521062__en-us_topic_0185264432_p3310135183216">When there are unsaved changes in File Terminals, user will be given an option to save or cancel on graceful exit of data studio.</p>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="DWS_DS_118.html">SQL Terminal</a></div>
|
|
</div>
|
|
</div>
|
|
|