Wednesday, March 23, 2011

DD Objects/Fields queries in BRM

This is a simple but very useful search to find the table name for a storable class in BRM. It is many times a difficult job specially in highly customized environments. Execute the following query by connecting to the BRM database :

SQL> select dof.SM_ITEM_NAME from dd_objects_t do,dd_objects_fields_t dofwhere do.OBJ_ID0=dof.OBJ_ID0 and do.NAME like '<CLASSNAME>' and dof.SM_ITEM_NAME not like ':%' and dof.SM_ITEM_NAME not like 'au_%'

 
Replace the <CLASSNAME> with the exact class for which you want to search the table, e.g.

SQL> select dof.SM_ITEM_NAMEfrom dd_objects_t do,dd_objects_fields_t dof where do.OBJ_ID0=dof.OBJ_ID0 and do.NAME like '/service' and dof.SM_ITEM_NAME not like ':%' and dof.SM_ITEM_NAME not like 'au_%'

Similarly, we can search the storable class name from the table name. Use the following query :

SQL> select dof.SM_ITEM_NAME,do.name from dd_objects_t do,dd_objects_fields_t dof where do.OBJ_ID0=dof.OBJ_ID0 and dof.SM_ITEM_NAME like 'account_t'


Following query can be used to find the storable classes where a BRM field is used:



select do.name from dd_objects_t do,dd_objects_fields_t dof where dof.field_name ='<FIELD_NAME>' and do.obj_id0=dof.obj_id0;


e.g.,


select do.name from dd_objects_t do,dd_objects_fields_t dof where dof.field_name ='PIN_FLD_ITEM_NO' and do.obj_id0=dof.obj_id0;

2 comments:

  1. From key word is missing in above Query.

    select dof.SM_ITEM_NAME,do.name from dd_objects_t do,dd_objects_fields_t dof where do.OBJ_ID0=dof.OBJ_ID0 and dof.SM_ITEM_NAME like 'account_t'

    Regards
    KVC

    ReplyDelete

Migrating PDC data from one system to another

Given System “A” with BRM and PDC and System “B” with BRM and PDC, following is the process for moving new or changed pricing data from ...