Defines a CMISQL query which selects documents or folders from a CMIS Repository.
CMISQL is a query language based on a subset of the SQL-92 grammar, with some extensions specific to CMIS. A CMISQL statement takes the following general form:
SELECT <Properties> FROM <Type> [WHERE <Conditions>] [ORDER BY <Sort>]
A CMISQL query specifies the type of item being searched for, the criteria for matching items, the order in which results should be returned, and what properties should be returned with each result. All properties and content types used in a CMIS Query must be referenced using their "query name".
The content type specified in the FROM clause serves 2 primary purposes. Firstly, it defines what properties are available in the SELECT, WHERE, and ORDER BY clauses. Secondly, it limits the scope of the search to objects of the specified type. (This includes objects with a type inheriting from the specified type.)
Predicate Type | Description | Example |
---|---|---|
Comparison Predicate | Specifies a condition for an individual property. | invoice_date < '12/31/2007' |
IN Predicate | Specifies a list of allowed values for a property. | FileExtension IN ('.pdf', '.docx', '.xlsx') |
CONTAINS Predicate | Specifies a full-text query. | CONTAINS('mortgage AND payment AND NOT vehicle') |
Scope Predicate | Restricts the search scope to children or descendants of a folder. | IN_FOLDER(/Inbox) IN_TREE(/Inbox) |
SELECT * FROM INVOICES WHERE (invoice_amount>5000) AND (freight<100) ORDER BY invoice_amount DESC
SELECT po_number, invoice_no, invoice_date, freight, sales_tax, invoice_amount FROM INVOICES WHERE (invoice_no='123456789')
SELECT * FROM File WHERE FileExtension IN ('.pdf', '.docx') AND cmis:creationDate > '1/1/2018' AND CONTAINS('grooper AND cmis')
SELECT * FROM Message WHERE Subject LIKE '%grooper%' AND DateTimeSent > '1/1/2018' AND CONTAINS('training')
No properties are defined