IBM FileNet P8, Version 5.2.1            

Query Syntax

The syntax for a Content Engine query conforms generally to the SQL-92 standard and is aligned with SQL Server query syntax. Relational queries use this syntax exclusively as opposed to content-based retrieval (CBR) queries; CBR queries include a full-text search function call as part of the SQL statement for the query. The syntax for the search function call depends on the Content Search Engine that runs the search.

The following examples show a relational query and a CBR query:

SELECT d.[DocumentTitle], d.[From], d.[Id] 
        FROM Document d 
        WHERE d.[Creator] = "jsmith"
SELECT d.This 
        FROM Document d 
        INNER JOIN ContentSearch c ON d.This = c.QueriedObject 
        WHERE CONTAINS(d.*,'lion AND tiger')

To run a relational query, Content Engine converts the query SQL statement into a functionally equivalent statement that can be natively understood by the database engine. For example, if the database engine for the object store is DB2®, Content Engine converts the query into a query that is understandable by a DB2 query. For more information about relational queries, see Relational Queries.

To run a CBR query, Content Engine runs the full-text search separately from the query that is represented by the full SQL statement. As shown in the example, the full-text search is expressed in statements such as "lion AND tiger". These expressions are passed directly to IBM® Content Search Services. The results from the full-text search are placed into a temporary table that is joined with the other query-referenced tables. The query can then be run as a standard relational query. For information about CBR queries, see CBR Queries.



Last updated: October 2015
query_sql_syntax_ref.htm

© Copyright IBM Corporation 2015.