<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"><a href="#MethodsDetails" class="navisub">Methods' Details</a></td> <td class="navisub">Attributes' Summary</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>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> </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 criterias. 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 criterias. 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/></dt> <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> </table> <a href="#_top_">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright © 2008 Sun Microsystems, Inc.</p> </div> <!-- id="adc-idlref" --> </body> </html>