Rename MCT Table name to static table names and attribute name

Rename MCT Table name to static table names and attribute name

book

Article ID: KB0082224

calendar_today

Updated On:

Products Versions
TIBCO MDM ALL

Description

The use case where the customer wants to rename the MCT table name to static or other name and attribute name.
The attribute name contains user-defined attribute and default one. Using procedure we can rename the user-defined attribute as well as default one.

Issue/Introduction

Rename the MCT table names and attribute names

Environment

Product: TIBCO MDM Version: All supported versions OS: All Supported Operating Systems

Resolution

===========
The steps required to change the mct table names:
===========
1. alter table MCT_XXXX rename to YYYY;

2. Update the catalog table :
Update catalog set tablename = 'YYYY' where id = XXXX and modversion= mod_version ;

where XXXX is master catalog id, YYYY is static table name and mode version is like 1 2 3..so on.

Consider an example:
Suppose I have one table MCT_34461  and I want to change the name of that table.

-alter table
   MCT_34461
rename to
   temp123;

   commit;

Update catalog set tablename = 'temp123'
   where id = 34461 and modversion= 3 ;

   commit;

===========

===========
The steps required to change the column names:
===========

1.alter table MCT_XXXX rename column Existing_column to New_column
  commit

2.update catalogattribute set DBCOLUMNNAME='New_column' where catalogid=XXXX and ATTRIBUTEPOSITION=1; 
commit

you can find that "attributeposition" from below query:

select attributeposition from catalog attribute where catalogid=XXXX and DBCOLUMNNAME='Columnname';

columnname is the column name that you want to change.

Consider Example:
Suppose I want to rename the CPRODUCTID column to ID

-alter table 
MCT_34340
rename column CPRODUCTID to ID
commit

-update catalogattribute set DBCOLUMNNAME='ID' where catalogid=34340 and ATTRIBUTEPOSITION=1; 
commit

for "attributeposition" :

select attributeposition from catalogattribute where catalogid=34416 and DBCOLUMNNAME='CPRODUCTID';

============
After all, changes are done restart the server, it will reflect all changes.
Note: The above procedure is not recommended for Production environment. Its usage should be limited to development and test environments only.