<html> <head> <title>Interface XSingleSelectQueryAnalyzer</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="../../../../idl.css"> </head> <body> <div id="adc-idlref"> <a name="_top_"> </a><table class="navimain" border="0" cellpadding="3"> <tr> <td class="navimain"><a href="../module-ix.html" class="navimain">Overview</a></td> <td class="navimain"><a href="module-ix.html" class="navimain">Module</a></td> <td class="navimain"><a href="XSingleSelectQueryAnalyzer-xref.html" class="navimain">Use</a></td> <td class="navimainnone">Devguide</td> <td class="navimain"><a href="../../../../index-files/index-1.html" class="navimain">Index</a></td> </tr> </table> <table class="navisub" border="0" cellpadding="0"> <tr> <td class="navisub"><a href="#MethodsSummary" class="navisub">Methods' Summary</a></td> <td class="navisub">Attributes' Summary</td> <td class="navisub"><a href="#MethodsDetails" class="navisub">Methods' Details</a></td> <td class="navisub">Attributes' Details</td> </tr> </table> <hr> <table border="0" width="100%" cellpadding="5" cellspacing="3" class="title-table" style="margin-bottom:6pt;"> <tr> <td><p class="namechain"><a href="../../../../module-ix.html" class="namechain">::</a> <a href="../../../module-ix.html" class="namechain">com</a> :: <a href="../../module-ix.html" class="namechain">sun</a> :: <a href="../module-ix.html" class="namechain">star</a> :: <a href="module-ix.html" class="namechain">sdb</a> :: </p> </td> </tr> <tr> <td class="title"><table class="title-table" width="99%"> <tr> <td width="25%" class="title2">unpublished </td> <td width="50%" class="title">interface XSingleSelectQueryAnalyzer</td> <td width="*"/></tr> </table> </td> </tr> <tr> <td/></tr> <tr> <td><dl> <dt><b>Usage Restrictions</b></dt> <dd><i>not published</i></dd> <dt><b>Description</b></dt> <dd>simplifies the analyzing of single select statements. </dd> <dd><p> The interface can be used for analyzing single SELECT statements without knowing the structure of the used query. </p> </dd> </dl> </td> </tr> </table> <hr> <a name="MethodsSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle" colspan="2">Methods' Summary</td> </tr> <tr> <td class="imsum_left"><a href="#getQuery">getQuery</a></td> <td class="imsum_right">returns the query. </td> </tr> <tr> <td class="imsum_left"><a href="#setQuery">setQuery</a></td> <td class="imsum_right">sets a new query for the composer, which may be expanded by filters, group by, having and sort criteria. </td> </tr> <tr> <td class="imsum_left"><a href="#getFilter">getFilter</a></td> <td class="imsum_right">returns the used filter. </td> </tr> <tr> <td class="imsum_left"><a href="#getStructuredFilter">getStructuredFilter</a></td> <td class="imsum_right">returns the currently used filter. </td> </tr> <tr> <td class="imsum_left"><a href="#getGroup">getGroup</a></td> <td class="imsum_right">returns the currently used GROUP BY. </td> </tr> <tr> <td class="imsum_left"><a href="#getGroupColumns">getGroupColumns</a></td> <td class="imsum_right">returns the currently used group. </td> </tr> <tr> <td class="imsum_left"><a href="#getHavingClause">getHavingClause</a></td> <td class="imsum_right">returns the used HAVING filter. </td> </tr> <tr> <td class="imsum_left"><a href="#getStructuredHavingClause">getStructuredHavingClause</a></td> <td class="imsum_right">returns the currently used HAVING filter. </td> </tr> <tr> <td class="imsum_left"><a href="#getOrder">getOrder</a></td> <td class="imsum_right">returns the currently used sort order. </td> </tr> <tr> <td class="imsum_left"><a href="#getOrderColumns">getOrderColumns</a></td> <td class="imsum_right">returns the currently used sort order. </td> </tr> <tr> <td class="imsum_left"><a href="#getQueryWithSubstitution">getQueryWithSubstitution</a></td> <td class="imsum_right">returns the query previously set at the analyzer, with all application-level features being substituted by their database-level counterparts. </td> </tr> <tr> <td class="imsum_left"><a href="#setCommand">setCommand</a></td> <td class="imsum_right">sets a new query for the composer, which may be expanded by filters, group by, having and sort criteria. </td> </tr> </table> <a name="MethodsDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle">Methods' Details</td> </tr> <tr> <td class="imdetail"><a name="getQuery" class="membertitle">getQuery</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">string</td> </tr> <tr> <td valign="top"><b>getQuery</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the query. </dd> <dt><b>Returns</b></dt> <dd>the query </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setQuery" class="membertitle">setQuery</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setQuery</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> command )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>sets a new query for the composer, which may be expanded by filters, group by, having and sort criteria. </dd> <dt><b>Parameter command</b></dt> <dd>the single select statement to set </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs or the statement isn't a single select statement or the statement isn't valid or the statement can not be parsed. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getFilter" class="membertitle">getFilter</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">string</td> </tr> <tr> <td valign="top"><b>getFilter</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the used filter. </dd> <dd><p> The filter criteria returned is part of the where condition of the select command, but it does not contain the where token. </p> </dd> <dt><b>Returns</b></dt> <dd>the filter </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getStructuredFilter" class="membertitle">getStructuredFilter</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">sequence< sequence< ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/PropertyValue.html">PropertyValue</a> > ></td> </tr> <tr> <td valign="top"><b>getStructuredFilter</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the currently used filter. </dd> <dd><p> The filter criteria is split into levels. Each level represents the OR criteria. Within each level, the filters are provided as an AND criteria with the name of the column and the filter condition. The filter condition is of type string. The operator used, is defined by <a href="SQLFilterOperator.html">SQLFilterOperator</a>. </p> </dd> <dt><b>Returns</b></dt> <dd>the structured filter </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getGroup" class="membertitle">getGroup</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">string</td> </tr> <tr> <td valign="top"><b>getGroup</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the currently used GROUP BY. </dd> <dd><p> The group criteria returned is part of the GROUP BY clause of the select command, but it does not contain the GROUP BY keyword . </p> </dd> <dt><b>Returns</b></dt> <dd>the group </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getGroupColumns" class="membertitle">getGroupColumns</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">::com::sun::star::<a href="../container/module-ix.html">container</a>::<a href="../container/XIndexAccess.html">XIndexAccess</a></td> </tr> <tr> <td valign="top"><b>getGroupColumns</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the currently used group. </dd> <dd><p> The columns returned form the GROUP BY clause. </p> </dd> <dt><b>Returns</b></dt> <dd>a collection of com::sun::star::sdb::GroupColumn which form the GROUP BY. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getHavingClause" class="membertitle">getHavingClause</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">string</td> </tr> <tr> <td valign="top"><b>getHavingClause</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the used HAVING filter. </dd> <dd><p> The HAVING filter criteria returned is part of the HAVING condition of the select command, but it does not contain the HAVING token. </p> </dd> <dt><b>Returns</b></dt> <dd>the filter </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getStructuredHavingClause" class="membertitle">getStructuredHavingClause</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">sequence< sequence< ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/PropertyValue.html">PropertyValue</a> > ></td> </tr> <tr> <td valign="top"><b>getStructuredHavingClause</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the currently used HAVING filter. </dd> <dd><p> The HAVING filter criteria is split into levels. Each level represents the OR criteria. Within each level, the filters are provided as an AND criteria with the name of the column and the filter condition. The filter condition is of type string. The operator used, is defined by <a href="SQLFilterOperator.html">SQLFilterOperator</a>. </p> </dd> <dt><b>Returns</b></dt> <dd>the structured HAVING filter </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getOrder" class="membertitle">getOrder</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">string</td> </tr> <tr> <td valign="top"><b>getOrder</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the currently used sort order. </dd> <dd><p> The order criteria returned is part of the ORDER BY clause of the select command, but it does not contain the ORDER BY keyword . </p> </dd> <dt><b>Returns</b></dt> <dd>the order </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getOrderColumns" class="membertitle">getOrderColumns</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">::com::sun::star::<a href="../container/module-ix.html">container</a>::<a href="../container/XIndexAccess.html">XIndexAccess</a></td> </tr> <tr> <td valign="top"><b>getOrderColumns</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the currently used sort order. </dd> <dd><p> The order criteria returned is part of the ORDER BY clause of the select command, but it does not contain the ORDER BY keyword . </p> </dd> <dt><b>Returns</b></dt> <dd>a collection of <a href="OrderColumn.html">OrderColumn</a> which form the ORDER BY. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getQueryWithSubstitution" class="membertitle">getQueryWithSubstitution</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">string</td> </tr> <tr> <td valign="top"><b>getQueryWithSubstitution</b>()</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>returns the query previously set at the analyzer, with all application-level features being substituted by their database-level counterparts. </dd> <dd><p>The <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a> is an application-level component, which in some respect understands SQL features usually not present at the database level. As a prominent example, you might pass a <code>SELECT</code> statement to the analyzer which is based on another query.</p> <p>While all other methods will handle those additional features transparently - e.g. the query in the <code>FROM</code> part of a <code>SELECT</code> statement will be handled as if it really is a table -, <code>getQueryWithSubstitution</code> gives you the SQL statement where all those features have been stripped, and replaced with appropriate standard SQL.</p> <p>For example, consider a database document which contains a client-side query named <code>All Orders</code>. This query is not known to the underlying database, so an SQL statement like <code>SELECT * from "All Orders"</code> would be rejected by the database. However, instantiating a <a href="SingleSelectQueryAnalyzer.html">SingleSelectQueryAnalyzer</a> at the <a href="Connection.html">Connection</a> object, and passing it the above query, you can then use <code>getQueryWithSubstitution</code> to retrieve a statement where <code>"All Orders"</code> has been replaced with the <code>SELECT</code> statement which actually constitutes the <code>"All Orders"</code> query.</p> </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if the query represented cannot be completely substituted. A usual case for this is a recursion in the sub queries: Consider a query named <code>foo</code>, which is defined as <code>SELECT * FROM "bar"</code>. Now assume that <code>bar</code> is a query defined as <code>SELECT * FROM "foo"</code>. Passing either of those statements to an analyzer, and calling <a href="#getQueryWithSubstitution">getQueryWithSubstitution</a>, would result in an exception being thrown, since it's impossible to substitute the sub queries with their constituting statements. </dd> <dt><b>Since </b></dt> <dd>OOo 2.0.4 </dd> <dt><b>See also</b></dt> <dd><a href="Connection.html">Connection</a>, <a href="XQueriesSupplier.html">XQueriesSupplier</a>, <a href="DatabaseDocument.html">DatabaseDocument</a></dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setCommand" class="membertitle">setCommand</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setCommand</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> Command,</td> </tr> <tr> <td/><td valign="top">[in] long</td> <td valign="bottom"> CommandType )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>sets a new query for the composer, which may be expanded by filters, group by, having and sort criteria. </dd> <dt><b>Parameter Command</b></dt> <dd>is the command which should be executed, the type of command depends on the CommandType. <p>In case of a <a href="#CommandType">CommandType</a> of <a href="CommandType.html">CommandType</a>::<a href="CommandType.html#COMMAND">COMMAND</a>, means in case the <a href="#Command">Command</a> specifies an SQL statement, the inherited ::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/RowSet.html">RowSet</a>::<a href="../sdbc/RowSet.html#EscapeProcessing">EscapeProcessing</a> becomes relevant:<br/> It then can be to used to specify whether the SQL statement should be analyzed on the client side before sending it to the database server.<br/> The default value for ::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/RowSet.html">RowSet</a>::<a href="../sdbc/RowSet.html#EscapeProcessing">EscapeProcessing</a> is <b>true</b>. By switching it to <b>false</b>, you can pass backend-specific SQL statements, which are not standard SQL, to your database.</p> </dd> <dt><b>Parameter CommandType</b></dt> <dd>is the type of the command. </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs or the statement isn't a single select statement or the statement isn't valid or the statement can not be parsed. </dd> <dt><b>See also</b></dt> <dd><a href="CommandType.html">CommandType</a>, ::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/RowSet.html">RowSet</a>::<a href="../sdbc/RowSet.html#EscapeProcessing">EscapeProcessing</a>, <a href="CommandType.html">CommandType</a></dd> </dl> </td> </tr> </table> </td> </tr> </table> <a href="#_top_">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright © 2000, 2012 LibreOffice contributors and/or their affiliates. All rights reserved.</p><p class="copyright" align="center">LibreOffice was created by The Document Foundation, based on OpenOffice.org, which is Copyright 2000, 2010 Oracle and/or its affiliates.</p><p class="copyright" align="center">The Document Foundation acknowledges all community members, please find more info <a href="http://www.libreoffice.org/about-us/credits/" target="_blank">at our website</a>.<p> </p><p class="copyright" align="center"><a href="http://www.libreoffice.org/privacy" target="_blank">Privacy Policy</a> | <a href="http://www.libreoffice.org/imprint" target="_blank">Impressum (Legal Info)</a> | Copyright information: The source code of LibreOffice is licensed under the GNU Lesser General Public License (<a href="http://www.libreoffice.org/download/license/" target="_blank">LGPLv3</a>). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our <a href="http://wiki.documentfoundation.org/TradeMark_Policy" target="_blank">trademark policy</a>.</p> </div> <!-- id="adc-idlref" --> </body> </html>