blob: 509631791da0aa12f74ba4f9d144ed0e4cdd56c0 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="copyright" content="(C) Copyright 2005"/>
<meta name="DC.rights.owner" content="(C) Copyright 2005"/>
<meta name="DC.Type" content="task"/>
<meta name="DC.Title" content="Executing a SQL File"/>
<meta name="abstract" content="You can execute a SQL file from the SQL File Editor or from WorkSpace Navigator."/>
<meta name="description" content="You can execute a SQL file from the SQL File Editor or from WorkSpace Navigator."/>
<meta name="DC.subject" content="dtp"/>
<meta name="keywords" content="dtp"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700452591.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700456982.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700458544.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700459919.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700453997.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700455575.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700404058.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700405683.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700407058.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700408496.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700409121.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700461576.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700463513.html"/>
<meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700480170.html"/>
<meta name="DC.Creator" content="ekapner"/>
<meta name="DitaCms:MapImporter:OriginalFileFullPath" content="\\kohman-xpvm1\tech_pubs_base_pool_1\projects\workspace\dmp\en\source\t_executing_a_sql_file.xml"/>
<meta name="DitaCms:MapImporter:OriginalObjectId" content="t_414c8t836_1_761_5814_060606"/>
<meta name="status" content="Authoring:initial"/>
<meta name="source" content="Map Importer"/>
<meta name="comment:system" content="Imported topic [2008/12/19 08:27:46]"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="asc1229700466482"/>
<meta name="DC.Language" content="en-US"/>
<link rel="stylesheet" type="text/css" href="../../styles/commonltr.css"/>
<link rel="stylesheet" type="text/css" href="../../styles/doc.css"/>
<title xmlns:xs="http://www.w3.org/2001/XMLSchema">Executing a SQL File</title>
<meta name="provider" content="Sybase, Inc."/></head>
<body id="asc1229700466482"><a name="asc1229700466482"><!-- --></a>
<br/>
<h1 class="topictitle1"> Executing a SQL File</h1>
<div><p>You can execute a SQL file from the SQL File Editor or from
<span>WorkSpace</span> Navigator.
</p>
<div class="p" id="asc1229700466482__prereq_CDF9C7BC88BC4229894D1E718B4CFB12"><a name="asc1229700466482__prereq_CDF9C7BC88BC4229894D1E718B4CFB12"><!-- --></a><strong class="prereq-title">Prerequisites </strong>
<p>Make sure the database server is running and you are connected to it through a connection profile.</p>
</div>
<div class="p" id="asc1229700466482__step_4440E6C6CBFD491185FF8F48059714BA"><a name="asc1229700466482__step_4440E6C6CBFD491185FF8F48059714BA"><!-- --></a>
<span>Execute the SQL
file using one of the following methods.</span>
<a name="asc1229700466482__choicetable_548241948D364AAF88F0BBF836978739"><!-- --></a>
<table border="1" frame="hsides" rules="rows" cellpadding="4" cellspacing="0" summary="" class="choicetableborder" id="asc1229700466482__choicetable_548241948D364AAF88F0BBF836978739">
<thead><tr><th valign="bottom" align="left" id="d7860e54-option">Option</th>
<th valign="bottom" align="left" id="d7860e54-desc">Description</th></tr></thead>
<tbody>
<tr>
<td valign="top" headers="d7860e54-option" id="d7860e67"><strong>From SQL File Editor</strong></td>
<td valign="top" headers="d7860e54-desc d7860e67">
<br/><a name="asc1229700466482__ol_F1ACFB2811DA420E939B71F9FF936302"><!-- --></a><ol type="a" id="asc1229700466482__ol_F1ACFB2811DA420E939B71F9FF936302">
<li id="asc1229700466482__li_CE9A8B6451FA464F99998E67A92C679F"><a name="asc1229700466482__li_CE9A8B6451FA464F99998E67A92C679F"><!-- --></a>In the <span>WorkSpace</span> Navigator project folder, double-click to open the SQL file in SQL File Editor.
</li>
<li id="asc1229700466482__li_DB04BEAD568541F29AAD2939C741001F"><a name="asc1229700466482__li_DB04BEAD568541F29AAD2939C741001F"><!-- --></a>Right-click in the editor, and select
<span class="uicontrol">Execute All</span>.
</li>
</ol>
</td>
</tr>
<tr>
<td valign="top" headers="d7860e54-option" id="d7860e91"><strong>From <span>WorkSpace</span> Navigator
</strong></td>
<td valign="top" headers="d7860e54-desc d7860e91">
<br/><a name="asc1229700466482__ol_7F4FAE8C6F324969BC2D704DF438AB4B"><!-- --></a><ol type="a" id="asc1229700466482__ol_7F4FAE8C6F324969BC2D704DF438AB4B">
<li id="asc1229700466482__li_2EC9BFB751B846CF995DEA2AA4123F39"><a name="asc1229700466482__li_2EC9BFB751B846CF995DEA2AA4123F39"><!-- --></a>Select one or more SQL files.</li>
<li id="asc1229700466482__li_D66C40C5DD8B463EA765F5BF43247D0D"><a name="asc1229700466482__li_D66C40C5DD8B463EA765F5BF43247D0D"><!-- --></a>Right-click the
files and choose
<span class="uicontrol">Execute SQL File</span>.
</li>
<li id="asc1229700466482__li_FC7ED6103FF245DCAF919D8C921CC788"><a name="asc1229700466482__li_FC7ED6103FF245DCAF919D8C921CC788"><!-- --></a>If you selected multiple SQL files, click <span class="uicontrol">OK</span> in the <span class="uicontrol">Select Profiles for the File</span> dialog.</li>
</ol>
</td>
</tr>
<tr>
<td valign="top" headers="d7860e54-option" id="d7860e124"><strong>From the toolbar
</strong></td>
<td valign="top" headers="d7860e54-desc d7860e124">
<br/><a name="asc1229700466482__ol_7B996DA1382C4429AC67F2B5C220298A"><!-- --></a><ol type="a" id="asc1229700466482__ol_7B996DA1382C4429AC67F2B5C220298A">
<li id="asc1229700466482__li_BA112C97D8C543E696940597655C01D9"><a name="asc1229700466482__li_BA112C97D8C543E696940597655C01D9"><!-- --></a> Click the
<a name="asc1229700466482__image_A1CB8DDADADD4D8BA0DAA9BCE11F7618"><!-- --></a><img id="asc1229700466482__image_A1CB8DDADADD4D8BA0DAA9BCE11F7618" src="../image/asc1229700464935.image" height="22" width="23" alt="&#34;Choose a .sql File to Execute&#34; &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9; "/>
<span class="uicontrol">Choose One or More SQL Files to Execute</span>
button on the Database
Development perspective toolbar.
</li>
<li id="asc1229700466482__li_4B227BFBC0924FB5B4A0D818460AF6BC"><a name="asc1229700466482__li_4B227BFBC0924FB5B4A0D818460AF6BC"><!-- --></a> On your file system, navigate to your workspace and project.</li>
<li id="asc1229700466482__li_E0829010C34341408AB3B00A9FE24B59"><a name="asc1229700466482__li_E0829010C34341408AB3B00A9FE24B59"><!-- --></a>Select the SQL
files you want to execute from the file system, and click
<span class="uicontrol">Open</span>.
</li>
<li id="asc1229700466482__li_3AA3359B8C554B128FF66FC79E08BE20"><a name="asc1229700466482__li_3AA3359B8C554B128FF66FC79E08BE20"><!-- --></a>Select the <span class="uicontrol">Database Server Type</span>, <span class="uicontrol">Connection Profile Name</span>, and <span class="uicontrol">Database Name</span>.</li>
<li id="asc1229700466482__li_59762246B57243D09AEFAA78843FAE26"><a name="asc1229700466482__li_59762246B57243D09AEFAA78843FAE26"><!-- --></a>(Optional) If you
did not create a connection profile for this database type, click
<span class="uicontrol">Create</span>.
</li>
<li id="asc1229700466482__li_E7A3B183694F457891FCA8162CF07130"><a name="asc1229700466482__li_E7A3B183694F457891FCA8162CF07130"><!-- --></a> Click
<span class="uicontrol">OK</span>.
</li>
</ol>
</td>
</tr>
</tbody></table>
<p>The SQL file executes, and results appear in the SQL Results view.
SQL Results view
displays the result sets, database server messages,
execution status (success or failure) and operation details.
</p>
</div>
</div>
<div><div class="relconcepts"><strong>Related concepts</strong><br/>
<div><a href="../../doc/html/asc1229700453997.html" title="Use the SQL File Editor to create and edit SQL statements.">SQL File Editor</a></div>
<div><a href="../../doc/html/asc1229700455575.html" title="SQL Scrapbook enables you to quickly create and execute SQL commands and queries, as well as procedural objects without creating a SQL file.">SQL Scrapbook</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br/>
<div><a href="../../doc/html/asc1229700452591.html" title="Use Database Development tools to create SQL files.">Creating a SQL File</a></div>
<div><a href="../../doc/html/asc1229700456982.html" title="Edit the SQL statements in a SQL file.">Editing a SQL File</a></div>
<div><a href="../../doc/html/asc1229700458544.html" title="Open a SQL file for viewing or editing in the SQL File Editor.">Opening a SQL File</a></div>
<div><a href="../../doc/html/asc1229700459919.html" title="Save one or more SQL files to the current project, or save a SQL file to a different project or to a different file name.">Saving a SQL File</a></div>
<div><a href="../../doc/html/asc1229700461576.html" title="Execute a SQL statement from an editor.">Executing a SQL Statement</a></div>
<div><a href="../../doc/html/asc1229700463513.html" title="Use the Eclipse launch configuration mechanism to run an ad hoc SQL query.">Running an Ad Hoc SQL Statement</a></div>
<div><a href="../../doc/html/asc1229700480170.html" title="Use the SQL Results view to see the results of an executed SQL query or routine procedural object.">Viewing SQL Results</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br/>
<div><a href="../../doc/html/asc1229700404058.html" title="SQL Editor preferences define the behavior of the SQL File Editor.">SQL Editor Preferences</a></div>
<div><a href="../../doc/html/asc1229700405683.html" title="SQL Editor Code Assist preferences define the behavior of the Code Assist feature in SQL File Editor.">Code Assist Preferences</a></div>
<div><a href="../../doc/html/asc1229700407058.html" title="SQL files and scrapbooks preferences define the behavior of SQL files in SQL File Editor and SQL Scrapbook.">SQL Files/Scrapbooks Preferences</a></div>
<div><a href="../../doc/html/asc1229700408496.html" title="Indicate your preferences for syntax coloring and text style for SQL source code in SQL Editor or SQL Scrapbook.">Syntax Coloring Preferences</a></div>
<div><a href="../../doc/html/asc1229700409121.html" title="You can create new SQL templates and edit existing ones.">Templates Preferences</a></div>
</div>
</div>
<div/>
</body>
</html>