search
HomeDatabaseMysql TutorialPowerDesigner实用技巧小结(3)

1、PowerDesigner 使用 MySQL 的 auto_increment ◇问题描述: PD怎样能使主键id使用MySQL的auto_increment呢? ◇解决方法: 打开tableproperties窗口→columns→选中id列→打开columnsproperties窗口→勾选identity即可 注意:概念模型没有此选项,物理模

1、PowerDesigner 使用 MySQL 的 auto_increment
◇问题描述:
PD怎样能使主键id使用MySQL的auto_increment呢?
◇解决方法:
打开tableproperties窗口→columns→选中id列→打开columnsproperties窗口→勾选identity即可
注意:概念模型没有此选项,物理模型才有


2、PowerDesigner 去掉 SQL 脚本中的双引号
◇问题描述:
PD生成Oracle数据库建表SQL时,默认会给表名和字段名加上双引号,怎样能去掉SQL脚本中的双引号呢?
◇解决方法:
选择Database->Edit current database->Script->Sql->Format,有一项CaseSensitivityUsingQuote,它的 comment为"Determines if the case sensitivity for identifiers is managed using double quotes",表示是否适用双引号来规定标识符的大小写, 可以看到右边的values默认值为"YES",改为"No"即可!


3、PowerDesigner 生成S QL 语句时不使用 Domain
◇问题描述:
如果在PD中使用了Domain,生成SQLServer的数据库SQL的脚本中会使用与Domain对应的自定义数据类型,而不会使用SQLServer自己的数据类型,怎样能让PD生成SQL语句时使用SQLServer自己的数据库类型,而不是Domain对应的自定义数据类型呢?
◇解决方法:
把Database→EditCurrentDBMS→General→Script→Objects→Domain→Enable设置为NO即可


4、PowerDesigner 中设置 Entity 的默认字体
◇问题描述:
创建Entity时,如果PD默认字体不适合自己的个人习惯,每次创建了一个实体后都要修改实体的字体,非常麻烦,是否有只修改一次一劳永逸的方法呢?
◇解决方法:
Tools→DisplayPreferences...→Format→Entity→Modity...→Font→进行相应修改并保存设置→SetAsDefault


5、PowerDesigner中设置 Entity 自动调整尺寸大小
◇问题描述:
当给Entity添加了字段或其他修改时,Entiry的显示尺寸大小不会自动调整,怎样解决呢?
◇解决方法:


6、PowerDesigner 中设置表格属性 preview
◇问题描述:
点击表格属性preview生成的sql语句要怎么修改个,怎样解决呢?
◇解决方法:
在选择的table上点击右键→单击properties...菜单项→选择physicaloptions就可以设置,设置完再点击左下角的applyto
在preview选项里面最上面的工具栏,点击showgenerationoptions可以设置其它生产sql语法的格式。

7、建立一个表后,为何检测出现Existence of index的警告

A table should contain at least one column, one index, one key, and one reference.
可以不检查 Existence of index 这项,也就没有这个警告错误了!
意思是说没有给表建立索引,而一个表一般至少要有一个索引,这是一个警告,不用管也没有关系!

8、由CDM生成PDM时,自动生成的外键的重命名

PDM Generation Options->Detail->FK index names默认是%REFR%_FK,改为FK_%REFRCODE%,

其中%REFRCODE%指的就是CDM中Relationship的code!另外自动生成的父字段的规则是

PDM Generation Options->Detail->FK column name template中设置的,默认是%.3:PARENT%_%COLUMN%,

可以改为Par%COLUMN%表示是父字段!


9、PowerDesigner 生成 SQL 时报错

◇问题描述:
生成sql的方法是 Database -->Generate Database (Ctrl + G ) 但是提示

Could not load VBScript engine.
Check VBScript installation.

Generation aborted due to errors detected during the verification of the model.

◇解决方法:
检查了好久 发现将check model 去掉就可以了!其中,

one file on是否需要按照表生成许多个sql(默认选上,即不需要)
odbc generation sql直接生成到数据库中
Automatic archive 生成sql同时生成apm文件。

check model

powerdesigner有定义每种数据库的表名、字段名等名字的最大长度的,该长度用于powerdesigner作check model的,但是该定义的长度

和数据库实际允许的长度不一定相同,如果你希望能通过pd的检查,可以修改pd中的设置(pd对不同数据库的这种约定实际是在保存在一个xml文件中

,扩展名为.xdb)!或者你可以直接在生成数据库时选择不check model.
估计pd给出的默认名字长度少于数据库允许长度是给出一种命名习惯,命名不要太长。

10、修改报表 模板中一些术语的定义

即文件:C:\Program Files\Sybase\PowerDesigner Trial 11\Resource Files\Report Languages\Chinese.xrl
Tools-Resources-Report Languages-选择Chinese-单击Properties或双击目标
修改某些对象的名称:Object Attributes\Physical Data Model\Column\
ForeignKey:外键
Mandatory:为空
Primary:主键
Table:表
用查找替换,把"表格"替换成"表"
修改显示的内容为别的:Values Mapping\Lists\Standard,添加TRUE的转化列为是,FALSE的转化列为空
另外Report-Title Page里可以设置标题信息

11、修改sql 脚本格式

必要时可以通过修改模板(Database-Edit Current DataBase)改变脚本的格式。例如:
Script-Objects-Column-Add的Value中开头增加一行"--%COLNNAME%"以便在脚本中显示列的中英文对照

12、允许不同实体存在同名属性

model options中,将数据项的唯一代码和允许重用两个选项去掉。否则不同实体中的同名属性会被认为是同一个数据对象,

改一个另外的也会跟着改 。大多数情况下都不需要这种特性,相反它会带来麻烦。 但是,如果允许不同的表有相同的字段名,

在创建视图的时候,需要为重复的字段名指定别名。 有利有弊啊。

13、将CDM设计的实体在PDM中不生成表

在实体的General选项中,去掉Generate选项,不知PDM中是否也是这样,需验证。

14、一个表关联的表非常多

在物理模型中,对于一个关联非常多的表,可以使用Ctrl+M 创建这个表的多个快捷方式,然后使用Ctrl+鼠标拖动已有的联接矛点.

15、一次键入非常多的对象

如果需要一次性加入多个相同类型的对象,可以在左侧的窗口右击模型名称,选择List of 想要加入的对象,这样就可以在一个列

表中使用向下键加入了,也可以方便的copy和paste.

使用模型check的功能,可以自动检查模型存在的一些问题,并可以选择自动修正操作.

有时PowerDesigner自动生成的唯一约束Key会重复,并且重复的key有时不能够全部被check出来,需要手动修改.

16、编辑视图删除无用字段

无法在实际SQL中生效.

当在SQL Query的字段列表中使用as语法时,有时更改as后面的列名不能在Column页中进行同步,导致创建视图中实际的

create or replace view v1(column1, column2, ..., columnN) as

...

/

如果没有不一致,则不会生成括号部分.

17、视图在数据库中的创建顺序

定义的视图可能互相之间会有引用关系,必须严格的按先后顺序创建,否则会出错,但powerDesigner在生成视图sql时不能指定

先后顺序,是以视图名称来安排生成顺序的.

如果在oracle中,可以指定视图的属性 force 为true, 这样创建视图引用的对象即使不存在也不会报错.

18、改变Diagram 的显示格式

在Diagram的tables 中显示Schema

Tools -> Display Preferences -> Object view -> Table,选中 Owner.

默认地, 这只改变当前的diagram,如果希望一起变更其他已经建立的diagrams,点击左下角的 Apply To按钮,然后选择

希望变更的diagrams。如果希望这个变更对所有新建的diagram都有效,就点击按钮Set As Default。

默认的References 线条很难看

Tools -> Display Preferences -> Format -> Reference,点击Modify,Line Style. -> Corners,选择第二个或者

第三个折线格式,OK退出。表的列数太多,导致diagram中对象太长

Tools -> Display Preferences -> Object view -> Table -> Table Columns,uncheck All Columns,选择Limit,

数值用10或者20。也可以选择PK Columns 只显示primary keys,或者选择Key Columns 只显示primary keys,

foreign keys, alt keys等keys。把整个diagram 或者部分导出为图形文件

选择要导出的对象(用shift多选,或者鼠标划亮多个) ,如果导出整个diagram就Ctrl+A,然后Edit -> Export Image,

文件类型选择jpeg或者png,保存。

同时修改多个对象格式

如果使用shift键选中多个,然后右键->Format,不会同时修改多个对象。但选中多个后,使用Ctrl+T快捷键却可以。

设置命名转换

设置概念模型Entry只显示主键

设置允许Relationship code重名

设置改面模型允许Data Item Reuse

Data Item

似乎是版本11带来的功能,原来9.5版本的模型没有这个选项

可以在不同的表之间Reuse Data Item(Column),这样可以实现一处修改,到处生效。

Reused Data Item,一个表中修改非空约束,不会反映到其它表。

可以在List Of Data Item视图中删除重复的项目。

19、PowerDesigner 在设计时,如何显示表中的注释选项
选定一个编辑的表,右键- >Properties- >Columns- >Customize Columns and Filter(或直接用快捷键Ctrl+U)- >Comment(前面打勾)- >OK 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software