2021:CMISQL Query: Difference between revisions
Dgreenwood (talk | contribs) |
Dgreenwood (talk | contribs) No edit summary |
||
| Line 11: | Line 11: | ||
In general the CMISQL statement takes the following form: | In general the CMISQL statement takes the following form: | ||
<code><span style="color:blue">SELECT</span> * <span style="color:blue">FROM</span> <Object Type> <span style="color:blue">WHERE</span> <Conditions> <span style="color:blue">ORDER BY</span> <Sort Criteria></code> | <code> | ||
<span style="color:blue">'''SELECT'''</span> * <span style="color:blue">'''FROM'''</span> <Object Type> | |||
<span style="color:blue">'''WHERE'''</span> <Conditions> | |||
<span style="color:blue">'''ORDER BY'''</span> <Sort Criteria> | |||
</code> | |||
For example, if you wanted to retrieve all email messages in your Inbox folder over an Exchange '''CMIS Connection''' from a particular sender and order results by the date you received the email (oldest first), you could use the following query: | |||
<code><span style="color:blue">'''SELECT'''</span> * <span style="color:blue">'''FROM'''</span> Message | |||
<span style="color:blue">'''WHERE'''</span> (Sender '''LIKE''' '%user@example.com' '''AND''' <span style="color:blue">IN_FOLDER</span>('/Inbox')) | |||
<span style="color:blue">'''ORDER BY'''</span> DateTimeReceived <span style="color:blue">ASC</span></code> | |||
Revision as of 09:58, 31 May 2022
CMIS Queries are utilized to search documents in CMIS Repositories and to filter documents upon import when using the Import Query Results provider.
Also called a "CMISQL query", the querying language CMIS Queries use is based on a subset of the SQL-92 grammar. Where SQL is a querying language to search and select data in a database, "CMISQL" is a querying language to search and select documents (and their metadata properties) in a storage location, represented by a CMIS Repository in Grooper.
About
CMIS Queries use clauses to retrieve content from a CMIS Repositories based on certain metadata property values, much like a SQL query uses clauses to retrieve data from a database based on column values. In both cases, a SELECT clause is used to select content based on certain conditions determined by a WHERE clause
In general the CMISQL statement takes the following form:
SELECT * FROM <Object Type>
WHERE <Conditions>
ORDER BY <Sort Criteria>
For example, if you wanted to retrieve all email messages in your Inbox folder over an Exchange CMIS Connection from a particular sender and order results by the date you received the email (oldest first), you could use the following query:
SELECT * FROM Message
WHERE (Sender LIKE '%user@example.com' AND IN_FOLDER('/Inbox'))
ORDER BY DateTimeReceived ASC