Update DQL

Here you will find different variations of UPDATE DQL Statements

The most used DQL statement to update a content object’s attribute value in a docbase.
UPDATE dm_document
       OBJECT SET title='SOME TITLE'
     WHERE r_object_id='09XXXXXXX'


If you know the object name and folderpath, you can use the DQL update like this:
UPDATE dm_document
       OBJECTS SET title='SOME TITLE'
     WHERE object_name='some-object-name'
       and folder ('/WebCabinet/somefolderName',descend)


How to Execute a DQL statement using API:
execquery,c,F,UPDATE dm_document OBJECT SET title='SOME-TITLE' WHERE object_name= 'SOMEOBJECTNAME'


1. To update an object’s date attribute with object’s creation date , in a certain folder and some other conditions ( escaping checked out objects) (Hint: Make a list of objects which are locked out by users, on which executing the update  statement will fail and subsequent execution of dql with stop)
Use this select statement to find the objects which are in locked state.

select object_name, r_object_id from <your-object-type> where folder ('/Folder1/folder2',descend) and release_date is nulldate and r_lock_owner is nullstring )

update <your-object-type> objects set release_date = r_creation_date where r_object_id in (select r_object_id from <your-object-type> where folder('/Folder1/folder2',descend) and release_date is nulldate and r_lock_owner is nullstring)


2. There will be situations where you will see lots and lots of inbox items, if you are using Web Publisher or Web Top or any other WDK based applications. As an administrator  I get various types of notifications, tasks, emails which on a periodic basis would like to delete them.

Here I found a useful DQL query, to delete them.
Use the following update DQL statement when you want to keep the Workflow related items untouched in the inbox.

update dmi_queue_item object set  delete_flag=1 where name='<userid>' and delete_flag=0 and router_id='0000000000000000';

But if you don’t want to keep any items in the Inbox use the slightly modified update DQL statement given below:

update dmi_queue_item object set  delete_flag=1 where name='<userid>' and delete_flag=0 ;

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: