Tapping the power of PowerDesigner 7.x Extended Attributes
PowerDesigner 7.5 support for Extended Attributes is contained in the Database Definition or the Object Language Definition. The instructions provided below will discuss making changes to a Database Definition file, but most instructions will also apply to Object Language definitions. In every definition file there can be an Extended Attributes section. This section will contain Types and Objects.
Types are used for restricting what is allowed for entry into an Extended Attribute. When Types are created they are assigned a name, comment and a list of allowed values. Types are used by Extended Attributes by assigning them as the attributes Data Type.
Objects are the container to hold your extended attributes.
As you require extended attributes they are added to the appropriate objects
within this section of the definition file. In most cases this subfolder
will be empty, and desired objects are added to them as needed.
Select Tools > Resources > DBMS or Object Languages.
Step 1: Create a copy of the target you would like to change, just in case. In most cases you want to extend the behavior of one of the supplied target databases.
- In the List of DBMS's dialog, click the New button
- In the New DBMS dialog, Supply a Name which does not match any names currently in the list, in the example "Sybase AS Anywhere 7 Extended".
- In the New DBMS dialog, Select your target from Copy From dropdown list.
- The DBMS Properties dialog for your new database definition will be displayed.
- Click OK and you will be prompted with a Save As dialog, here you will name your new database definition as a .XDB file. These should be saved in the same directory as all the PowerDesigner supplied database definition or it will not show up in your list of target DBMS's. Although it does not matter what you call this file, we recommend including the original name as part of the new name so you know of the correlation. I named mine in the above example, syasa70ea.xdb.
- Your newly created definition should appear in the list.
Step 2: Define Extended Attributes.
- In the List of DBMS's Dialog, Select the newly created definition and Click the Properties button
- The DBMS Properties Dialog is displayed. Expand the Extended Attributes section. Note: if it does not exist, right-Click on the top level which should be your database name. Select Add Items... In the Selection(DBMS Template) dialog, check Extended Attributes and click OK.
- Expand the Objects sub-folder.
- If the object for which you want to create attributes is not listed
- Right-Click on Objects and select Add Items...
- In the Selection(DBMS Template::Extended Attributes::Objects) dialog, select the checkbox next to the object you want
- Click OK
- Right Click on the type of object you want to create attributes for
- Select New > Extended Attribute. This will create a new extended attribute with a default name such as New1.
- Expand the type of object folder to find this newly created extended attribute and select it. Your screen should look like the following example.
- Assign a name to the extended attribute in the Name field. The name entered will be displayed when entering values and can also be used as a variable when generating scripts.
- Enter comments describing the purpose of the extended attribute
- Assign the extended attribute a datatype based on the type of information you would like to store in it. i.e. String
- Assign a default value if desired
- Click OK to accept your changes.
- Click Close in the List of DBMS's, you should be prompted to save your database definition.
- Once we change our target DBMS to our newly created definition our extended attribute should be accessible.
- They are accessed via the properties dialog for each object, which should contain an Extended Attributes tab for object which have them defined.
Step 1: Create the type
- Open DBMS Properties Dialog and expand the Extended Attributes section.
- Right Click on the Type section
- In the context menu select New > Extended Attribute Type. This will create a new extended attribute type with a default name such as New1.
- Expand the Type folder to find this newly created extended attribute type and select it.
- Assign a name to the extended attribute type in the Name field. This name will become a new variable type, used when defining extended attributes.
- Enter comments describing the purpose of the extended attribute type.
- Click the Add a Value button in the List of Values section
- Enter the desired value
- Repeat as needed,
The following screen shows the completed Extended Attribute definition. Notice that my Extended Attibute Type is now in my list of valid Data Types.
The following screen shows the Extended Attibute in use on the table Employee. Notice that entry is restricted to the list of valid categories.
- Supporting Global Temporary Tables in Adaptive Server Anywhere 6 using PowerDesigner 7 or 8
- Supporting Global Temporary Tables in Oracle 8i using PowerDesigner 7 or 8
- Supporting Deferred Constraints for Oracle 8i using PowerDesigner 8.x
- Generating Grant Statements on Tables using PowerDesigner 7 & 8