Skip to Content

powerdesigner - customization of database object using macro or vbscript.

How can I parameterize a new database object in powerdesigner in order to replicate tables and rename them as work tables.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Jun 07 at 09:08 AM

    In a script, use the CreateReplica function to replicate a table; then you should be able to rename the replica table. If you need to edit more than just the table name, you may need to access the replication rules, and I'm not sure where they are in the object model

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 10 at 11:28 AM

    If you replicate table into the same package as source table (it could be root level of the model as well), its Name and Code properties are automatically de-replicated, which means that you can modify the Name of replicated table instantly.

    If you replicate tables between two different packages (with different Namespaces) or between two diffrent models, Name and Code are replicated/synchronized by default. To de-replicate certain properties you have to open the properties of replicated table and go to Version Info tab. You can open the replication properties from there. And choose which attributes, collections and/or sub-replication you need to keep in sync and which you don`t.

    Ondrej

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 11 at 08:38 AM

    One more thing. If you need to dereplicate certain attributes (e.g. Name, Code or anything else) by script, you need to use its attribute SourceReplication to get to the replication properties and the modify the string property called Attributes. See my example below, which dereplicates table name. Name of the replicated table in my example is "XXX".

    For each t in Activemodel.Tables
      If t.Name = "XXX" then
        output t.SourceReplication.Attributes
        t.SourceReplication.Attributes = Replace(t.SourceReplication.Attributes, "Name" + vbLf, vbLf)
        output t.SourceReplication.Attributes
      End if
    Next

    Regards,

    Ondrej

    Add comment
    10|10000 characters needed characters exceeded