What are the steps to register a table in Documentum?

Options
vsoman1984
edited June 1, 2010 in Documentum #1

Hi All,

I have gone through quite many discussions on the web pertaining to this same issue of registering a table in Documentum.So here is a synopsis of my struggle:)

1) I had the need to have a new table inside my documentm database.So i created a new table through my SQL (Studio Express) manually (using click on Tables --> New Table)

2) I had the following lines in my function - an action event on a button click:

StringBuffer strQueryBufin = new StringBuffer(); strQueryBufin.append("Insert into dbo.dm_freeway_mapping Values ('").append(docuId).append("','").append(freewayID).append("','").append(freewayPwrd).append("')"); IDfCollection iCollectionin =null; DfQuery queryin = new DfQuery();queryin.setDQL( strQueryBufin.toString() );iCollectionin = queryin.execute( getDfSession(), DfQuery.DF_QUERY );


I had no knowledge of the need of an external table to be "registered" prior to its usage while writing the above code and hence i faced the following error:

15:38:44,704 ERROR [http-8080-2] com.documentum.web.common.Trace - invokeMethod() failed while calling: saveActionMapping
[DM_QUERY_E_TABLE_NO_ACCESS]error:  "The table, dbo.dm_freeway_mapping, is not registered or you do not have access to it."
DfException:: THREAD: http-8080-2; MSG: [DM_QUERY_E_TABLE_NO_ACCESS]error:  "The table, dbo.dm_freeway_mapping, is not registered or you do not have access to it."; ERRORCODE: 100; NEXT: null
        at com.documentum.fc.client.impl.docbase.DocbaseExceptionMapper.newException(DocbaseExceptionMapper.java:57)
        at com.documentum.fc.client.impl.connection.docbase.MessageEntry.getException(MessageEntry.java:39)
        at com.documentum.fc.client.impl.connection.docbase.DocbaseMessageManager.getException(DocbaseMessageManager.java:137)
        at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.checkForMessages(NetwiseDocbaseRpcClient.java:305)
        at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.applyForCollection(NetwiseDocbaseRpcClient.java:429)
        at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$3.evaluate(DocbaseConnection.java:1143)


3) Having gone through a few similar instances on the net i have reached the following assumptions and these are my questions:

a) REGISTER TABLE dm_dbo.table_name (column list); -- is the syntax to register tables inside documentum.But they cannot be actually executed inside SQL ( i actually tried executing this command on SQL and soon realized that the REGISTER keyword is not even a registered one in SQL). Is my conclusion correct?

b)  This syntax of registering a table needs to be written through DQL as seen in the Java code (for insert) seen under (2). Is my conclusion correct?

c) What should be the solution to register a table through java only once.Because  if i have the query to register a table on every action event , this query will be fired as many times. How can i over come this situation? Is there a check akin to "if table exists" to dissallow the register query being fired multiple times?

I hope i will get the prompt support like i have recieved over the months from this wonderful learning curve called EMC Community.

Thanks & Regards

Vishnu Soman

Answers

  • Jacob_Willig
    edited May 31, 2010 #2
    Options

    a+b) You should do this in DQL, so use a DQL client like in Documentum Administrator. This CANNOT be done in SQL (database side) as you are registering the table in Documentum, not in the Database..

    See below DQL statements.

    #If you want to register (using DQL):

    REGISTER TABLE dm_dbo.dm_freeway_mapping (r_object_id STRING(16))

    #If you want to give owner update access:

    UPDATE dm_registered OBJECT
    SET owner_table_permit=7
    WHERE object_name = 'dm_freeway_mapping'

    #If you want to unregister:

    UNREGISTER dm_freeway_mapping

    c) I would not recommend doing this programatically, but if you really want to or need to:

    - use above dql statements (register + update)

    - if you want to check, query dm_registered table: (DQL) select r_object_id from dm_registered where object_name='dm_freeway_mapping'

    if that has result, it is already registered.

    good luck.

    P.S. Read some of the documentation on registered tables. It should explain most of this as well.

    regards,

    Jacob Willig

  • sijohnm
    edited June 1, 2010 #3
    Options

    For the point "c" you have mentioned in your post.

    "What should be the solution to register a table through java only once.Because  if i have the query to register a table on every action event , this query will be fired as many times. How can i over come this situation? Is there a check akin to "if table exists" to dissallow the register query being fired multiple times? "

    Response: You have to register a table in Documentum only once as part of your deployment of your new application. When you register the table in documentum using REGISTER DQL keyword, it creates an entry in dm_registered object.

    For your second question of "if table exists/registered", you can query the dm_registered object something like this

    select object_name from dm_registered where table_name = '<<your-table-name>>'

  • vsoman1984
    edited June 1, 2010 #4
    Options

    Hi Jacob ,

    I could not have asked for a better solution ur suggestions really did guide me through to customize my application. A zillion thanks.

    For some reason i am getting an ECN error while i am trying to flag this post as answered and ur reply as Correct answer .

    For others seeking similar solutions, Jacobs answer is the way to go .

    Thanks to sijohnm too. I surely will carry out ur suggestion and keep the forum posted on my progress.

    Thank you again

    Regards

    Vishnu

  • @Jacob_Willig said:
    a+b) You should do this in DQL, so use a DQL client like in Documentum Administrator. This CANNOT be done in SQL (database side) as you are registering the table in Documentum, not in the Database..

    See below DQL statements.

    If you want to register (using DQL):

    REGISTER TABLE dm_dbo.dm_freeway_mapping (r_object_id STRING(16))

    If you want to give owner update access:

    UPDATE dm_registered OBJECT
    SET owner_table_permit=7
    WHERE object_name = 'dm_freeway_mapping'

    If you want to unregister:

    UNREGISTER dm_freeway_mapping

    c) I would not recommend doing this programatically, but if you really want to or need to:

    • use above dql statements (register + update)

    • if you want to check, query dm_registered table: (DQL) select r_object_id from dm_registered where object_name='dm_freeway_mapping'

    if that has result, it is already registered.

    good luck.

    P.S. Read some of the documentation on registered tables. It should explain most of this as well.

    regards,

    Jacob Willig

    Hi Jacob

    Works great for us in Documentum 6.7 SP2

    Thanks a lot!