Symbian3/SDK/Source/GUID-B61EA8C5-0966-51DE-AC73-01DD34C7D3CC.dita
changeset 0 89d6a7a84779
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Symbian3/SDK/Source/GUID-B61EA8C5-0966-51DE-AC73-01DD34C7D3CC.dita	Thu Jan 21 18:18:20 2010 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
+<!-- This component and the accompanying materials are made available under the terms of the License 
+"Eclipse Public License v1.0" which accompanies this distribution, 
+and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
+<!-- Initial Contributors:
+    Nokia Corporation - initial contribution.
+Contributors: 
+-->
+<!DOCTYPE concept
+  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
+<concept xml:lang="en" id="GUID-B61EA8C5-0966-51DE-AC73-01DD34C7D3CC"><title>Deleting Rows from a Table</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to delete rows from a database table. </p> <section><title>Introduction</title> <p>The deletion of a record from a database can be performed by executing the <codeph>DELETE</codeph> SQL statement. The query does not pass or return any data. </p> </section> <section><title>Basic procedure</title> <ul><li id="GUID-9C914C4E-72E0-5115-8C66-BE37C6DBD21A"><p>Configure the SQL statement </p> </li> <li id="GUID-6CA0261D-EE6B-53B5-921C-163AB03F0D04"><p>Execute the statement. </p> </li> </ul> </section> <section><title>Detailed steps</title> <p><b>Configure the SQL statement</b> </p> <p>Create a literal for your <codeph>DELETE</codeph> statement. You do not need to create a <xref href="GUID-0176BF07-DF94-3259-8F90-DE030E35CE9A.dita"><apiname>RSqlStatement</apiname></xref> object to run a <codeph>DELETE</codeph> statement. You need to just execute the query with the <xref href="GUID-4688F6B7-E1B0-37CF-BAA2-C6BD103D4FDF.dita"><apiname>RSqlDatabase</apiname></xref> object, which has its own <xref href="GUID-4688F6B7-E1B0-37CF-BAA2-C6BD103D4FDF.dita#GUID-4688F6B7-E1B0-37CF-BAA2-C6BD103D4FDF/GUID-6D2120DC-C193-3E2E-A802-B4CD180BDF11"><apiname>RSqlDatabase::Exec()</apiname></xref> function taking a query string as its parameter. </p> <codeblock id="GUID-16ECCA77-5B8D-5D64-AFF0-ED634323C1DD" xml:space="preserve">_LIT(kQueryString,"DELETE FROM countries WHERE population &lt; 2;"); 
+</codeblock> <p> <b>NOTE :</b> It is possible to call a <codeph>DELETE</codeph> statement from an <xref href="GUID-0176BF07-DF94-3259-8F90-DE030E35CE9A.dita"><apiname>RSqlStatement</apiname></xref> object, but it is computationally more expensive and you are recommended not to do so. </p> <p><b>Execute the statement</b> </p> <p>Execute the <codeph>DELETE</codeph> statement. This code assumes that the <codeph>countriesDatabase</codeph> object is open. </p> <codeblock id="GUID-E247DCDC-8EAA-5543-AB4C-C938CEAA51FB" xml:space="preserve">countriesDatabase.Exec(kQueryString);</codeblock> </section> <section><title>See also</title> <p> <xref href="GUID-F36E5978-29FC-57E8-8A45-2003E7767193.dita">Querying a Database</xref>  </p> <p> <xref href="GUID-CCB9C61B-FB28-5CD9-A366-4A9584097897.dita">Inserting a Row into a Table</xref>  </p> <p>Deleting Rows from a Table - This document </p> <p> <xref href="GUID-72511204-FC90-54AA-9E2E-833318020318.dita">Reading to a Buffer</xref>  </p> <p> <xref href="GUID-3CCA6503-54DA-5558-85DC-93A22A81F565.dita"> Reading to Memory </xref>  </p> <p> <xref href="GUID-183280EE-0C57-54FE-8ABB-E1CC3BDE525B.dita">Reading to a Data Stream</xref>  </p> <p> <xref href="GUID-B9A3B17E-BDEB-5F66-968C-080335A721AC.dita">Writing to a Data Stream</xref>  </p> <p> <xref href="GUID-C474376E-1766-5781-B5BF-3786C5B4D72E.dita">Performing Scalar Queries</xref>  </p> </section> </conbody></concept>
\ No newline at end of file