Update based on subquery DQL
Hello Experts,
is it possible to update records based on subquery in dql?
I am trying this but it fails,
update dm_folder f objects set f.owner_name (select u.user_name from dm_user u where u.user_name=f.object_name)
Please let me know what I am doing wrong, unfortunately I could not find anything in google.
Thanks in advance
Comments
-
Hi Imran,
Yes, this is possible. Try with the below DQL
update dm_folder f objects set f.owner_name where f.owner_name = (select u.user_name from dm_user u where u.user_name=f.object_name)
Refer to Documentum Content Server <version> DQL Reference Manual.pdf
Hope this help you.
Regards,
Argha0 -
Exactly, you forget the Where clause !
0 -
Error occured during query execution :[DM_QUERY_E_SYNTAX]error: "A Parser Error (syntax error) has occurred in the vicinity of: update dm_folder f objects set f."
0 -
you are not setting f.owner_name
try
update dm_folder f objects set f.owner_name=u.user_name where f.owner_name = (select u.user_name from dm_user u where u.user_name=f.object_name)
now I haven't attempted to parse/execute this but it might have an issue with the owner_name = (select u. as this may return > 1 record.
might be worth updating via the dm_dbo.dm_folder_s and using a 'raw' sql style query
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax