In DFC, you can execute SQL directly (bypassing DQL) using the IDfSession.apiExec() method. The problem is that the method is marked deprecated in the current (6.x, 7.x) versions of the DFC API.
Here is sample code using the deprecated method:
IDfSession session; (...) String sql = "UPDATE dm_sysobject_s SET r_modifier = 'hacker' WHERE r_object_id = '<some_id>'"; session.apiExec("execsql", sql);
This works fine, but as mentioned, apiExec deprecated.
I also tried an alternative approach:
(...) IDfQuery query = new DfQuery(sql); query.execute(session, IDfQuery.DF_EXEC_QUERY);
As far as I know, this should work, but I keep getting the following message:
[DM_QUERY_E_REG_TABLE_PERMIT_IN]error: "You have insufficient privilege to UPDATE the dbo.dm_sysobject_s table."
I get the same error message when using IDfQuery.DF_QUERY , but either way, DF_EXEC_QUERY is the one that should work - or? Of course, I try this with the superuser account, so I donβt know what privileges I am missing.
Is there a good, not outdated way to execute source SQL queries from DFC?
I would also like to add that I understand very well that raw SQL is very discouraged as it bypasses the Documentum security model. I also know that I can use @SuppressWarnings("deprecation") in my Java code, but this does not make the method less obsolete.