Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"
<?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 id="GUID-EC33FF66-F15E-5316-8828-C6CFD57DB9E5" xml:lang="en"><title>Symbian
SQL Tracing Guide</title><shortdesc>This document discusses how to enable Symbian SQL tracing</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-8DC1D32E-F2AB-48C5-9BF9-4D7D49865FD5"><title>How to enable
Symbian SQL tracing</title> <p>You can enable SQL tracing in two steps. </p> <ul>
<li id="GUID-1AB89A3E-6ACD-543D-8AA9-B9034829E947"><p>Enable the executable
for trace. </p> </li>
<li id="GUID-DF51C397-6531-5CAF-A087-257E2FB06E8E"><p>Enable the trace type. </p> </li>
</ul> <p><b>Enabling
the executable for trace</b> </p> <p>The three sub-components of the Symbian
SQL library executable are the database client, the database server and the
SQLite static library with these .mmp files: </p> <ul>
<li id="GUID-A2B6B7EF-509F-52C7-A55C-20CAE7766995"><p>sqldb.mmp </p> </li>
<li id="GUID-2973082E-45F0-5829-B0E3-EA39BA8B0F06"><p>sqlsrv.mmp </p> </li>
<li id="GUID-20750D91-BA05-5623-9E54-E02BBFDE1EE4"><p>sqlite.mmp </p> </li>
</ul> <p>In each of these files look for the macro <codeph>SYMBIAN_INCLUDE_EXECUTABLE_TRACE</codeph> and
uncomment it. </p> <p><b>Enabling
the trace type</b> </p> <p>SQL traces are of three types: </p> <ul>
<li id="GUID-2F30AEB6-0C62-52F6-958F-892A5C0DDEA5"><p>Function entry and exit
traces: these traces generate timestamps indicating how long a function took
to execute and what its argument was. Where the argument is an SQL statement,
these traces are useful for identifying inefficient use of SQL. </p> </li>
<li id="GUID-7D1B8AF5-F525-5A4A-9C2C-465752DC73D8"><p>Error traces: these
trace function leaves and panics in the client and server and are useful for
debugging database applications. </p> </li>
<li id="GUID-1271AC2F-FEBA-579E-B990-B0EE1272B17C"><p>Key event traces: these
traces supply data about key events which are relevant to database implementation: </p> <ul>
<li id="GUID-E2CB61F2-5F38-54AE-B27D-A4FBC5BE1D36"><p>IPC calls sent to and
serviced by the SQL server. </p> </li>
<li id="GUID-45B84E0B-429D-5FCA-8144-DF807EC99545"><p>Startup and close of
the SQL server. </p> </li>
<li id="GUID-89FE8F63-FDE0-5D99-B8EA-21895FBDA866"><p>The number of full table
scans and sort operations performed by an <xref href="GUID-0176BF07-DF94-3259-8F90-DE030E35CE9A.dita"><apiname>RSqlStatement</apiname></xref> object. </p> </li>
</ul> </li>
</ul> <p>Traces of each type can be enabled independently. The file UTraceSql.h
defines the macros </p> <ul>
<li id="GUID-A208CA4B-DB3C-5C02-A356-CBF4560E81A5"><p> <codeph>SYMBIAN_TRACE_SQL_FUNC</codeph> to
enable function entry and exit traces, </p> </li>
<li id="GUID-4B10F95F-6A9D-5F28-8213-C006C6220A91"><p> <codeph> SYMBIAN_TRACE_SQL_ERR</codeph> to
enable error traces, and </p> </li>
<li id="GUID-520483F9-698B-55DF-9D47-1AB969D2ECAC"><p> <codeph>SYMBIAN_TRACE_SQL_EVENTS</codeph> to
enable key events. </p> </li>
</ul> <p>To enable tracing you uncomment the macro for the type of tracing
required. </p> </section>
<section id="GUID-04A105B3-DEC2-4E6C-9463-81357E5AFD08"><title>See Also</title> <p><xref href="GUID-321F406B-2C77-5F2B-9FDA-F25726188CE2.dita">Using Symbian SQL Trace Data
Guide</xref> </p> </section>
</conbody></concept>