Introduction to DQL –DQL is a super set of ANSI-standard SQL, which is used to create, manage and drop all documentum object types in Documentum.This is also used to register the RDBMS table in Documentum to manipulate all database functions by querying.
What is DQL?
DQL (Documentum Query Language) is a superset of SQL and which allows you to do very simple/complex queries in Documentum like
• Search objects using given properties
• Searches for Full text with the help of FT engine
• Queries the external database table by registering in to Documentum
• Does Complex queries like joins with Register table and Objects types
DQL supports most of the sql functions by its own syntax.DQL uses syntax that is a superset of ANSI-standard SQL (Structured Query Language). Infact, part of your DQL statements are translated automatically into SQL before being executed by the eContent Server
• DQL query is sent to the eContent Server using one of four API methods
readquery, execquery, query, or cachequery
• eContent Server generates executes this API methods which isactually calling the sql engine
– SQL queries for the RDBMS
– Verity queries for the full-text search engine
The results of the query are stored on the server in a non-persistent collection object. Typically, a Documentum client will automatically present the results of the query to the user in some useful way. Alternatively, a Developer may want to use the resulting collection object or
manipulate the results programmatically.
Select Statement
Select (list of properties to fetch)
From (list of object types to be search)
Using WHERE clause
Allows the search to be narrowed by imposing search conditions on your Query
select [all | distinct] value [as name] {,value [as name] } from source_list [(all)]
…
[where qualification ]
Eg 1:
SELECT object_name, title FROM dm_document WHERE FOLDER (ID(’folder id’)) AND title LIKE ’%sr%’
Searching for a document in given folder path or cabinets
The scope of the search can be specified as folder and cabinet in the where clause to provide a way to search the cabinet/folder hierarchy.
Eg 1:
SELECT object_name, title FROM dm_document WHERE FOLDER (‘/exact folder path’) AND title LIKE ’%SOP%’
Eg 2;
In case of not having folder id or exact folder path ,
SELECT object_name, title FROM dm_document WHERE FOLDER (‘/Cabinet name’,descend) AND title LIKE ’%SOP%’
Which searches the given documents with in the cabinet.
REGISTER Statement
• Registers an RDBMS table so that eContent Server can recognize the sql table
• Allows access to data in an existing RDBMS table that may be created to support additional application data part of another application owned by someone else
• Does not verify that the table or its columns exist
• All columns in a table need not be registered
• Creates a dm_registered object in the System cabinet which provides a description of the table and user access to it
REGISTER permissions
• Only the Docbase owner with a SUPERUSER privilege can register a table from
within Documentum.
• To register a table, you must have at least READ permission on the table (through the
RDBMS grant command).
• The eContent Server account (installation owner) needs the appropriate RDBMS
privileges on the table to perform different operations on rows in the table.
Steps to create Register Table
1.Register a RDBMS table by register keyword
REGISTER TABLE [owner_name.]table_name
(column_def {,column_def})
[[WITH] KEY (column_list)]
[SYNONYM [FOR] ‘table_identification’]
Eg: REGISTER TABLE johndoe.”remote1″ (“columnA” int)
Note: All columns in a table need not be registered.
2. Update appropriate permission to the users on the register table.
Eg:
Update dm_registered objects set owner_table_permit =15 set world_table_permit=15 set group_table_permit=15 where object_name=’remote1’
The above query will update maximum permission on the table.
SYNONYM
Use the SYNONYM clause to register RDBMS tables that have synonyms in the underlying tables.
SYNONYM FOR londonserver.londonremote.johndoe.myremotetable
After he registers the table, he issues the following SELECT statement:
SELECT * FROM johndoe.”remote1″
Content Server substitutes the actual table name for the synonym and the following
SQL is generated:
SELECT * FROM server.remote.johndoe.remotetable
Special note for Oracle platforms
If you create a database link between the database on which the Documentum repository
is installed and another database, and then the use SYNONYM feature to obtain
information from that second database, both databases must be in the same codepage.