Sunday 21 April 2019

openCMIS: Exploring SELECT Clause


In my previous posts, I explained basics of CMIS query. I am going to explain number of examples of SELECT query usage here.

a. Select all the documents in the repository
SELECT * FROM cmis:document

b. Select all the folders
SELECT * FROM cmis:folder

c. Select all the documents where the name of the document is ‘a.txt’.
SELECT * FROM cmis:document where cmis:name='a.txt'

d. Select only cmis:name, cmis:lastModificationDate for all the documents
SELECT cmis:name, cmis:lastModificationDate FROM cmis:document


Aliasing
Aliasing is used to give meaning full names to the columns in query result. By using ‘AS’ clause we can meaning ful names to column headers.

Let me rewrite the previous query like below.
SELECT cmis:name AS documentName, cmis:lastModificationDate AS modifiedDate FROM cmis:document


As you see above image, you can see column headers are meaningful now.

Previous                                                 Next                                                 Home

No comments:

Post a Comment