documentumemcdocumentum-dql

Documentum DQL Getting list subfolders from a few folders


everyone! I am starting with Documentum this month and here is my problem. There is multi-select drop-down list with cabinets. I have to choose some of them to get list of inner folders in my result list below. This query:

select * from dm_folder where folder(id($param$))

or

select * from dm_folder where folder($param$)

where param is object_name

works with single drop-down select. I've tried to insert "in"

select * from dm_folder where folder in($param$)

results with

[DM_QUERY_E_SYNTAX]error:  "A Parser Error (syntax error) has occurred in the vicinity of:  select * from dm_folder where folder in" 

or

select * from dm_folder where folder(id in($param$))

results with

select * from dm_folder where folder(id in ('0c0511d48000105',' 0c0511d48000106'))

[DM_QUERY_E_SYNTAX]error:  "A Parser Error (syntax error) has occurred in the vicinity of:  select * from dm_folder where folder(id in"

and return multivalue flag in queries above but it doesn't work. Can someone help, please? Thank you!


Solution

  • Try with this one:

    SELECT * FROM dm_folder WHERE r_object_id IN ('0c0511d48000105',' 0c0511d48000106')
    

    I think it's clear where you made an error. Keyword FOLDER you used is function that accepts single value as parameter.

    From DQL guide:

    The FOLDER predicate
    The FOLDER predicate identifies what folders to search. The syntax is:
    [NOT] FOLDER(folder_expression {,folder_expression} [,DESCEND])
    The folder_expression argument identifies a folder in the current repository. You cannot search a
    remote folder (a folder that does not reside in the current repository). Valid values are:
    • An ID function
    • The ID function (described in The ID function, page 29) identifies a particular folder.
    • A folder path
    A folder path has the format:
    /cabinet_name{/folder_name}
    Enclose the path in single quotes. Because cabinets are a subtype of folder, you can specify a
    cabinet as the folder.
    • The keyword DEFAULT
    The keyword DEFAULT directs the server to search the user’s default folder. Note that a user’s
    default folder is the same as the user’s default cabinet (because cabinets are a subtype of folders).
    

    Edit 1:

    SELECT * FROM dm_folder WHERE ANY i_folder_id IN ('0c0511d48000105',' 0c0511d48000106')
    

    With this query you are looking for folder type objects whose parent is any of the folders specified as the parameter.

    Edit 1:

    SELECT * FROM dm_folder WHERE i_cabinet_id IN (<list of ids>) 
    

    This will return you all folder objects under cabinet