PD User Guide

Source: Internet
Author: User
Tags sybase powerdesigner

Modify foreign key naming rules

Choose database> edit current DBMS.
Select scripts-> objects-> reference-> constname
The value on the right is:

FK _ %. u8: child % _ %. U9: refr % _ %. u8: parent %

It can be seen that the naming method is: 'fk _ '+ 8-seat table name + 9-digit reference name + 8-digit parent table name. You can customize the following mode:

FK _ %. u7: child % _ relations _ %. u7: parent %,

You can change the FK name to fk_table_2_relations_table_1.
After mastering this method, you can modify it according to your own ideas.

The header comment in the SQL file of the database creation script is annoying. You can select the options card in the Databse-> Generate database (CTRL + G) window and remove the usage title hook option.

Add foreign key
Model-> references: Create a foreign key and double-click it to enter the foreign key attribute. In the "joins" card, select the foreign key field of the sub-table.

 

How to achieve non-automatic equality of name and code
When you create an entity in CDM, the name and Code do not automatically match

Set tools -- gerneral options ---> dialog ----> name to code signing ing

-------------------------------------

How to display the name column in scrip

Modify the field generation rule. To add a comment for each field, expand the value of script-> Object-> column-> Add in the same window:

% 20: column % [% compute %? As (% compute %): % 20: datatype % [% identity %? % Identity %: [% null %] [% notnull %] [Default % default %]
[[Constraint % constname %] Check (% constraint %)]/* % colnname % */

% Colnname % indicates the column name value (which can be Chinese)

---------------------------------------------------------------------------------

Settings of powerdesigen auto-increment Columns

In PDM, view the table attributes. On the columns tab, select the entire column and view the column attributes. Click the properties icon in the upper-left corner (the one with a hand-shaped pattern). A setting window is displayed, in the General tab.
On the General tab of the column attribute, there is an identity check box. Just click it.

--------------------------------------
1. How to create an index under powerdesigner
2. How to create an auto-increment column under powerdesigner
3. How to check the design model under powerdesigner

1. How to create an index under powerdesigner
1. Double-click the table design drawing and click "Table properties". On the tab page, select "indexes ".

2. Click the attribute of the new index. indexex properties is displayed.

3. Add an index Field

2. How to create an auto-increment column under powerdesigner
2. Use the following statements in the sqlserver database to complete
In the table creation statement, add the following
Identity (1, 1)
You can also use the following statement to reset the auto-incrementing seed.
DBCC checkident (configsys, reseed, 0 );
3. How to check the design model under powerdesigner
1. Select Tools-check model in the menu bar, as shown in figure

2. Select each setting to be checked.

3. Confirm and check the summary of the results.
 

[This is from the deep blue residence in the blog Park. Please indicate the author's source for reprinting]

During this time, I used PD to create a database model. I felt very good. I would like to share my experience with you. I still have a lot of features and I don't have time to summarize them. If I have time, continue to make up for them.
1. How to create an index under powerdesigner
2. How to create an auto-increment column under powerdesigner
3. How to check the design model under powerdesigner

1. How to create an index under powerdesigner
1. Double-click the table design drawing and click "Table properties". On the tab page, select "indexes ".

2. Click the attribute of the new index. indexex properties is displayed.

3. Add an index Field

2. How to create an auto-increment column under powerdesigner
2. Use the following statements in the sqlserver database to complete
In the table creation statement, add the following
Identity (1, 1)
You can also use the following statement to reset the auto-incrementing seed.
DBCC checkident (configsys, reseed, 0 );
3. How to check the design model under powerdesigner
1. Select Tools-check model in the menu bar, as shown in figure

2. Select each setting to be checked.

3. Confirm and check the summary of the results.

Setting auto-increment indexes in powerdesigner does not require much trouble. In fact, you only need to set the columns field type to serial in the conceptual model!

 

1. Use powerdesigner to check database design errors ~

Powerdesigner can also be used to quickly detect database design errors in the new model.

Check the New Mode:

Select [Check model] from the [tools] menu.

The [Check model parameters] dialog box appears. You can use the default parameters.

You can also right-click the blank space and select Check model.

Click [OK].

The result of [Check model] is displayed in [result list.

2. How to convert conceptual data model (CDM) to physical data model (PDM )?

 

Converts a conceptual data model to a physical data model.

The difference between the two is that CDM is purely a conceptual model, and PDM is related to a specific database type, such as SQL Server 2000 or Oracle. To generate an SQL statement, you must also generate it from PDM.

 

Choose tools> Generate phisical data model from the menu.

 

Finally, select your database type.

 

3. Use powerdesigner to generate SQL statements ~

 

You can use powerdesigner to generate an SQL script that is used to implement all components of the model. Then, use an SQL script to generate a database.

Make sure that you are using PDM.

Generate an SQL script to create a database:

Select [generate database] from the [database] menu.

The [database generation] dialog box appears.

In the [Directory] field, type C: temp and newdemo. SQL in the [file name] field.

Make sure that [generation] is selected.

Click the [database] tab and make sure that [Create Database] is selected.

Browse other tabs to view options that control many other attributes of the script generated.

Click [OK].

After the script is created, the [Result] dialog box is displayed.

4. Why is the warning: Table existence of index table name?

 

The table is not indexed. However, this is a warning, not an error. Ignore it.

 

5. How do I create a federated primary key?

 

A federated primary key has multiple primary keys in a table. For example, in a table selected by a student, both the student ID and the course Id are primary keys.

 

When attributes is set, the p items of the two fields are checked. P indicates the primary key of the primary key.

 

6. How do I create a foreign key?

 

In powerdesigner, foreign keys can be automatically created by establishing relationship. You do not need to manually add them.

 

There are two ways to create a relationship: You can choose model-> relationships... from the menu, or drag the relationship control in the toolbar on the right.

 

7. How to generate a data dictionary?

 

You can use the report-> Report Wizard... menu to generate

Note that you can select template. Because it is generated through PDM, standard physical template ~ is selected ~

1. Install PD v11.0

2.PDMWhen a table creation script is generated, an error occurs when the field exceeds 15 characters (Oracle)
Unknown cause. The solution is to open the PDM, And the menu bar of the database appears. Go to database-edit current DBMS-script-objects-column-maxlen and increase the value (Originally 30 ), for example, change to 60. If the length of a table or other objects is incorrect, you can select the corresponding objects and change it accordingly!
Or use the following method:
When the table creation script is generated, the database generation prompt box will pop up: remove the options-check model, that is, do not check (not recommended )!
Alternatively, you can modify the c: \ Program Files \ Sybase \ powerdesigner trial 11 \ resource files \ DBMS \ oracl9i2. XDB file.
After modification, when CDM is converted to PDM, select "copy the DBMS definition in Model" to copy the resource file to the model.

3. How do I remove the double quotation marks of an object from the generated table creation script?
When CDM is enabled, go to tools-model options-naming convention and set the charcter case option of the name and code labels to uppercase or lowercase, as long as it is not a mixed case!
Alternatively, choose database-> edit current database-> script-> SQL-> Format. There is a casesensitivityusingquote, its comment is "determines if the case sensitivity for identifiers is managed using double quotes", which indicates whether double quotation marks are used to specify the case sensitivity of the identifier. You can see that the default value of values on the right is "yes ", change to "no!
Alternatively, when PDM is enabled, go to tools-model options-naming convention and set the charcter case option of the name and code labels to uppercase!

4. After creating a table, why does the warning of existence of index appear?
A table shoshould contain at least one column, one index, one key, and one reference.
This warning error does not occur if you do not check the existence of index!
This means that no index is created for the table, and at least one index is required for a table. This is a warning and it doesn't matter if you don't care!

5. When creating a table to modify a field, the code of the table changes as soon as the name is changed. How can I keep the code unchanged?
There is a button "=" on the right side of the name and code. If you do not need to synchronize, you can just pop up the button.
Tools-> General options-> dialog-> name to code sorting (remove)

6. When PDM is generated by CDM, the automatically generated foreign key is renamed.
PDM generation options-> detail-> FK index names is % refr % _ FK by default, changed to fk _ % refrcode %, where % refrcode % refers to the relationship code in CDM! In addition, the automatically generated parent field is set in PDM Generation Options> detail-> FK column name template. The default value is %. 3: parent % _ % column %. You can change it to PAR % column %, which indicates the parent field is used!

7. How to Prevent one-to-one relationship from generating two references (Foreign keys)
To define the dominant direction of the link, the dominant entity (with the d sign) becomes the parent table.
Double-click the one-to-one relationship in CDM-> detail-> dominant role to select the dominant relationship

8. modify the definition of some terms in the Report Template
That is, the file: C: \ Program Files \ Sybase \ powerdesigner trial 11 \ resource files \ report documents ages \ Chinese. XRL
Tools-resources-Report languages ages-select Chinese-click Properties or double-click the target
Modify the names of some objects: Object Attributes \ physical data model \ column \
Foreignkey: foreign key
Mandatory: NULL
Primary: Primary Key
Table: Table
Replace "table" with "table" with "Search"
Modify the displayed content to another value: Values mapping \ lists \ Standard. Add the true conversion column as yes, and the false conversion column as null.
In addition, you can set the title information in report-title page.

 

1. In PD, copying a column is actually a link. Changes to the source column are also reflected in the copy Column

2.DatabaseGeneral design steps: the main structure of CDM missing -- generate PDM -- modify it on PDM, and generate CDM if necessary

3. If PDM generates CDM and then generates PDM, the foreign key modified in PDM will be changed back to the default value.

4. If necessary, you can change the script format by modifying the template (Database-edit current database. For example:
Add a line "-- % colnname %" in the value of script-objects-column-add to show the Chinese and English comparisons of columns in the script.

5. Remove the annoying name and code ing: Tools-General options-Clear the name to code sorting ing check box

6. For a database (such as Oracle) That is case insensitive, powerdesign automatically adds double quotation marks to the table name and field name when creating a script to obtain a case-sensitive string.SQLIt is a lot of trouble to compile statements. Remove this additional feature:
Database-> edit current DBMS-> script.-> SQL-> Format-> casesensitivityusingquote
Select No for the right-side panel parameter value

7. PDM is generated by CDM, which can control whether to generate a reference for the link; a script is generated by PDM to control whether to generate a foreign key for the reference.

8. For Oracle, table setting options (such as tablespace gpssystem) can be used to create the correct tablespace. For the setting options for the primary key (using index tablespace gpsindex), the index is created to the correct tablespace.

 

(From: http://www.cnblogs.com/barney/archive/2008/07/08/1238450.html)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.