Powerdesign Advanced Applications

Source: Internet
Author: User

1, remove the Oracle generated SQL creation statements in double quotes
When you export the table SQL for a Orale database with PowerDesigner, the table name and field name are enclosed in double quotes, as shown in the following figure:

This is a great inconvenience to the operation of the database, the solution is to set database menu,

Then click on the edit current DBMS menu, turn on Script->format, and then find Casesensitivityusingquote
Set it to no, you can. The following figure:

If you have a package, select the table in the package when you export.

2, Powerdesign advanced application
Write the relevant VBS scripts in powerdesign custom commands and operations, and so on, you can refer to the C:/Program files/sybase/powerdesigner 9/vb Scripts Directory of the script sample. How to use these scripts.
You can operate in Tools->execute commands. Specific instructions in the help to write very clearly.  Position of help in PowerDesigner General Features guide-> Part 2.  Modeling Guide->chapter 8. Managing objects->accessing Objects using Vbscript->vbscript uses in PowerDesigner

The use of Powerdesign is primarily the configuration of DBMS
3, modify the Build table script generation rules.
If each table has the same field, you can modify it as follows:
The Database-> Edit current DBMS expands the Script-> Object-> Table-> Create See the value of the lower right, which can be directly modified as follows:

/* TableName:%tname% * *
CREATE TABLE [%qualifier%]%table% (
%tabldefn%
TS char (a) NULL default convert (char (), GETDATE (), 20),
Dr smallint null default 0
)
[%options%]

The TS, Dr Two columns are automatically inserted into each table when the SQL script is generated, where the%tname% variable is to add a name value annotation for each table's SQL.

4, modify the field generation rules .
To add a comment to each field, the value of the expand Script-> Object-> Column-> Add in the same window is modified to:

%20:column% [%compute%?as (%compute%):%20:datatype% [%identity%?%i dentity%:[%null%][%notnull%]][default%default%]
[[Constraint%constname%] Check (%constraint%)]]/*%colnname%*/

The%colnname% is the name value of the column (Can be Chinese)

5, modify the foreign key naming rules.
Select Database->edit Current DBMS
Choose scripts-"objects-" reference-"Constname
You can see that the value on the right is:

fk_%. u8:child%_%. u9:refr%_%. u8:parent%

Visible, the naming method is: ' Fk_ ' + 8-bit child table name + 9-bit reference name + 8-bit parent table name, which you can customize according to this pattern:

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 revise it according to your own ideas.

Generating the header comments in the Build Library script SQL file is annoying, you can select the options card in the databse-> Generate Database (ctrl+g) window and remove the usage title Hook option.

6. Add foreign key
Model-> references New foreign key, double-click into the foreign key properties, in the "joins" card can select the Foreign key field of the child table. The following figure:

Then the following screen appears:

Follow the steps.

7, cancel name and code linkage
When you modify name, the value of the code will change, which is inconvenient. Modification method: Powerdesign In the Options menu in the [tool]-->[general options]->[dialog]->[operating modes]->[name to Code Mirroring], where the default is to synchronize the name and code, the previous check box to remove the line. Figure:

 

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.