| <?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" xml:lang="en"> |
| <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="Creating a DELETE Statement"/> |
| <meta name="abstract" content="Use SQL Query Builder to create a DELETE statement to remove data from a specified table. By specifying one or more conditions, you can indicate which rows in the database table to delete. If you do not specify any conditions, all rows in the target table are deleted."/> |
| <meta name="description" content="Use SQL Query Builder to create a DELETE statement to remove data from a specified table. By specifying one or more conditions, you can indicate which rows in the database table to delete. If you do not specify any conditions, all rows in the target table are deleted."/> |
| <meta name="DC.subject" content="dtp"/> |
| <meta name="keywords" content="dtp"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700427574.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700429574.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700435668.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700437325.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700441997.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700445247.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700448153.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700449560.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700427574.html"/> |
| <meta name="DC.Relation" scheme="URI" content="../../doc/html/asc1229700410527.html"/> |
| <meta name="DC.Creator" content="ekapner"/> |
| <meta name="DitaCms:MapImporter:OriginalFileFullPath" content="\\kohman-xpvm1\tech_pubs_base_pool_1\projects\dtp\dtp\en\source\t_creating_a_delete_statement.xml"/> |
| <meta name="DitaCms:MapImporter:OriginalObjectId" content="task_39103C5219204211B05AD93CD15C86C7"/> |
| <meta name="status" content="Authoring:initial"/> |
| <meta name="source" content="Map Importer"/> |
| <meta name="comment:system" content="Imported topic [2008/12/19 08:27:23]"/> |
| <meta name="DC.Format" content="XHTML"/> |
| <meta name="DC.Identifier" content="asc1229700443669"/> |
| <meta name="DC.Language" content="en"/> |
| <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">Creating a DELETE Statement</title> |
| <meta name="provider" content="Sybase, Inc."/></head> |
| <body id="asc1229700443669"><a name="asc1229700443669"><!-- --></a> |
| <br/> |
| |
| <h1 class="topictitle1">Creating a DELETE Statement</h1> |
| |
| |
| |
| <div><p>Use SQL Query Builder to create a DELETE statement to remove data from a specified table. By specifying one or more conditions, you can indicate which rows in the database table to delete. If you do not specify any conditions, all rows in the target table are deleted.</p> |
| |
| <div class="p" id="asc1229700443669__prereq_5930838D1E4B4085BAFEA8A8EE8E6617"><a name="asc1229700443669__prereq_5930838D1E4B4085BAFEA8A8EE8E6617"><!-- --></a><strong class="prereq-title">Prerequisites </strong> |
| <p>Connect to the data source through a connection profile.</p> |
| |
| </div> |
| |
| <div class="section" id="asc1229700443669__context_62B42B04316F448985BA9979AADC287E"><a name="asc1229700443669__context_62B42B04316F448985BA9979AADC287E"><!-- --></a> |
| <div class="note"><span class="notetitle">Note:</span> Some syntactic variations might exist between your database and the SQL syntax that SQL Query Builder supports; consequently, some SQL Query Builder features might not work with your database.</div> |
| |
| </div> |
| |
| <a name="asc1229700443669__steps_B8A4586817414B0DA93706597FE9C513"><!-- --></a><ol id="asc1229700443669__steps_B8A4586817414B0DA93706597FE9C513"> |
| <li class="stepexpand" id="asc1229700443669__step_74A6938DAD2041E9B089D3D242710F69"><a name="asc1229700443669__step_74A6938DAD2041E9B089D3D242710F69"><!-- --></a> |
| <span>Open a new or an existing SQL file, and be sure to select the connection profile <span class="uicontrol">Type</span>, <span class="uicontrol">Name</span>, and <span class="uicontrol">Database</span>.</span> |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_924AFF8CF0B542508244A51D19DED26E"><a name="asc1229700443669__step_924AFF8CF0B542508244A51D19DED26E"><!-- --></a> |
| <span>In an appropriate place in the editor window, right-click and select <span class="uicontrol">Edit in SQL Query Builder</span>.</span> |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_741D24CDFA0D4C1C9F53A6D7560333C2"><a name="asc1229700443669__step_741D24CDFA0D4C1C9F53A6D7560333C2"><!-- --></a> |
| <span>In the Outline pane, right-click <span class="uicontrol">SELECT Statement</span> and select <span class="uicontrol">Change Statement Type</span>.</span> |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_365EF4B79CA444469085B05CF91EE83F"><a name="asc1229700443669__step_365EF4B79CA444469085B05CF91EE83F"><!-- --></a> |
| <span>Select <span class="uicontrol">DELETE</span> and click <span class="uicontrol">OK</span>.</span> |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_423A887D13BA4FD09F3553796A8510EA"><a name="asc1229700443669__step_423A887D13BA4FD09F3553796A8510EA"><!-- --></a> |
| <span>Select the table by right-clicking in the Tables pane and selecting <span class="uicontrol">Add Table</span>.</span> |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_0020F14FEB91412083F2FFBD7E6EDC5D"><a name="asc1229700443669__step_0020F14FEB91412083F2FFBD7E6EDC5D"><!-- --></a> |
| <span>(Optional) Indicate one or more conditions that target specific rows for deletion.</span> |
| <a name="asc1229700443669__substeps_A66F924801FE41A496D2BDDF7D55AA34"><!-- --></a><ol type="a" id="asc1229700443669__substeps_A66F924801FE41A496D2BDDF7D55AA34"> |
| <li class="substepexpand" id="asc1229700443669__substep_4DB60657AF294E2185F11CB4D860166D"><a name="asc1229700443669__substep_4DB60657AF294E2185F11CB4D860166D"><!-- --></a> |
| <span>Select a <span class="uicontrol">Column</span>.</span> |
| |
| <p>Alternately, select define a condition using the Expression Builder wizard.</p> |
| |
| |
| </li> |
| |
| <li class="substepexpand" id="asc1229700443669__substep_2CF94F40F7284125BB0C86F6A29E085C"><a name="asc1229700443669__substep_2CF94F40F7284125BB0C86F6A29E085C"><!-- --></a> |
| <span>Select an <span class="uicontrol">Operator</span>.</span> |
| </li> |
| |
| <li class="substepexpand" id="asc1229700443669__substep_4470642CED814304B028FC4F9BBDD5D2"><a name="asc1229700443669__substep_4470642CED814304B028FC4F9BBDD5D2"><!-- --></a> |
| <span>Enter a specific <span class="uicontrol">Value</span>, select a column from the drop-down list, or build an expression.</span> |
| </li> |
| |
| <li class="substepexpand" id="asc1229700443669__substep_AC078C9CB77E46F3B2E7B0015A2A9B53"><a name="asc1229700443669__substep_AC078C9CB77E46F3B2E7B0015A2A9B53"><!-- --></a> |
| <span>(Optional) Select <span class="uicontrol">AND</span> or <span class="uicontrol">OR</span> to specify another condition.</span> |
| </li> |
| |
| </ol> |
| |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_2894B59791D9415A8C6DD34F5BD3554D"><a name="asc1229700443669__step_2894B59791D9415A8C6DD34F5BD3554D"><!-- --></a> |
| <span>(Optional) To run the SQL code, in the SQL Source pane, right-click and select <span class="uicontrol">Run SQL</span>.</span> |
| |
| <p>View the results in the <span class="uicontrol">SQL Results</span> tab.</p> |
| |
| |
| </li> |
| |
| <li class="stepexpand" id="asc1229700443669__step_6258ABB7A0B44B1E9CAE212711F8F964"><a name="asc1229700443669__step_6258ABB7A0B44B1E9CAE212711F8F964"><!-- --></a> |
| <span>Click <span class="uicontrol">OK</span> to exit SQL Query Builder and to return to the SQL File Editor, where the SQL code displays in the editor window.</span> |
| |
| <p>Clicking <span class="uicontrol">Cancel</span> results in no changes to the SQL code in the SQL File Editor. You lose any changes you made in SQL Query Builder.</p> |
| |
| |
| </li> |
| |
| </ol> |
| |
| </div> |
| |
| <div> |
| <div class="familylinks"> |
| <div class="parentlink"><strong>Parent topic:</strong> <a href="../../doc/html/asc1229700427574.html" title="Create, edit, or run SQL statements using the SQL Query Builder graphical interface, which provides access to your database schema and objects so that you can quickly create or edit SQL statements without actually typing any SQL code. However, you also have the flexibility to add or modify the SQL code in the editor window.">SQL Query Builder</a></div> |
| </div> |
| <div class="relconcepts"><strong>Related concepts</strong><br/> |
| <div><a href="../../doc/html/asc1229700427574.html" title="Create, edit, or run SQL statements using the SQL Query Builder graphical interface, which provides access to your database schema and objects so that you can quickly create or edit SQL statements without actually typing any SQL code. However, you also have the flexibility to add or modify the SQL code in the editor window.">SQL Query Builder</a></div> |
| </div> |
| <div class="reltasks"><strong>Related tasks</strong><br/> |
| <div><a href="../../doc/html/asc1229700429574.html" title="Use SQL Query Builder to create a SELECT statement to retrieve data from a database and display the results set in table format.">Creating a SELECT Statement</a></div> |
| <div><a href="../../doc/html/asc1229700435668.html" title="Use SQL Query Builder to create an INSERT statement to insert new rows at the end of a table with the values you indicate for the specified columns.">Creating an INSERT Statement From a Values Set</a></div> |
| <div><a href="../../doc/html/asc1229700437325.html" title="Use SQL Query Builder to create an INSERT statement from a subquery.">Creating an INSERT Statement From a Subquery</a></div> |
| <div><a href="../../doc/html/asc1229700441997.html" title="Use SQL Query Builder to create an UPDATE statement to update data in a table. You can explicitly set the values or derive them from the results of a build expression.">Creating an UPDATE Statement</a></div> |
| <div><a href="../../doc/html/asc1229700445247.html" title="Use the Expression Builder in SQL Query Builder to build simple or complex expressions, or subqueries when creating SELECT, UPDATE, INSERT, and DELETE statements.">Building Expressions</a></div> |
| <div><a href="../../doc/html/asc1229700448153.html" title="Use SQL Query Builder to edit an individual SQL statement. You can only edit one SQL statement at a time.">Editing a SQL Statement</a></div> |
| <div><a href="../../doc/html/asc1229700449560.html" title="Use SQL Query Builder to run an individual SQL statement and view its execution results.">Running the SQL Statement Code</a></div> |
| </div> |
| <div class="relref"><strong>Related reference</strong><br/> |
| <div><a href="../../doc/html/asc1229700410527.html" title="Indicate the SQL Query Builder preferences.">SQL Query Builder Preferences</a></div> |
| </div> |
| </div> |
| <div/> |
| </body> |
| </html> |