2011年7月11日 星期一

powerdesigner 轉出五個meta data table

如果手上只有PDM,..想要產生 meta data table

Tools >> powerbuilder >>Generate Extended Attributes...


當然要先匯入powerbuilder extension,
Tool >>Extension >>Import an Extension,勾選powerbuilder

同時先準備好五個meta data table schema, 欄位名稱不能更改,但字串欄型態可加長.


CREATE TABLE [dbo].[pbcatcol](
    [pbc_tnam] [char](30) NOT NULL,
    [pbc_tid] [int] NULL,
    [pbc_ownr] [char](30) NULL,
    [pbc_cnam] [char](30) NOT NULL,
    [pbc_cid] [smallint] NULL,
    [pbc_labl] [nvarchar](254) NULL,
    [pbc_lpos] [smallint] NULL,
    [pbc_hdr] [nvarchar](254) NULL,
    [pbc_hpos] [smallint] NULL,
    [pbc_jtfy] [smallint] NULL,
    [pbc_mask] [nvarchar](31) NULL,
    [pbc_case] [smallint] NULL,
    [pbc_hght] [smallint] NULL,
    [pbc_wdth] [smallint] NULL,
    [pbc_ptrn] [nvarchar](31) NULL,
    [pbc_bmap] [char](1) NULL,
    [pbc_init] [nvarchar](254) NULL,
    [pbc_cmnt] [nvarchar](4000) NULL,
    [pbc_edit] [nvarchar](31) NULL,
    [pbc_tag] [nvarchar](254) NULL,
 CONSTRAINT [PK_pbcatcol] PRIMARY KEY CLUSTERED
(
    [pbc_tnam] ASC,
    [pbc_cnam] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
 
 GO
 
CREATE TABLE [dbo].[pbcatedt](
    [pbe_name] [nvarchar](30) NOT NULL,
    [pbe_edit] [nvarchar](254) NULL,
    [pbe_type] [smallint] NOT NULL,
    [pbe_cntr] [int] NULL,
    [pbe_seqn] [smallint] NOT NULL,
    [pbe_flag] [int] NULL,
    [pbe_work] [char](32) NULL,
 CONSTRAINT [PK_pbcatedt] PRIMARY KEY CLUSTERED
(
    [pbe_name] ASC,
    [pbe_seqn] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
 
CREATE TABLE [dbo].[pbcattbl](
    [pbt_tnam] [char](30) NOT NULL,
    [pbt_tid] [int] NULL,
    [pbt_ownr] [char](30) NULL,
    [pbd_fhgt] [smallint] NULL,
    [pbd_fwgt] [smallint] NULL,
    [pbd_fitl] [char](1) NULL,
    [pbd_funl] [char](1) NULL,
    [pbd_fchr] [smallint] NULL,
    [pbd_fptc] [smallint] NULL,
    [pbd_ffce] [char](32) NULL,
    [pbh_fhgt] [smallint] NULL,
    [pbh_fwgt] [smallint] NULL,
    [pbh_fitl] [char](1) NULL,
    [pbh_funl] [char](1) NULL,
    [pbh_fchr] [smallint] NULL,
    [pbh_fptc] [smallint] NULL,
    [pbh_ffce] [char](32) NULL,
    [pbl_fhgt] [smallint] NULL,
    [pbl_fwgt] [smallint] NULL,
    [pbl_fitl] [char](1) NULL,
    [pbl_funl] [char](1) NULL,
    [pbl_fchr] [smallint] NULL,
    [pbl_fptc] [smallint] NULL,
    [pbl_ffce] [char](32) NULL,
    [pbt_cmnt] [nvarchar](4000) NULL,
 CONSTRAINT [PK_pbcattbl] PRIMARY KEY CLUSTERED
(
    [pbt_tnam] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


 
CREATE TABLE [dbo].[pbcatvld](
    [pbv_name] [nvarchar](30) NOT NULL,
    [pbv_vald] [nvarchar](254) NOT NULL,
    [pbv_type] [smallint] NOT NULL,
    [pbv_cntr] [int] NULL,
    [pbv_msg] [nvarchar](254) NULL,
 CONSTRAINT [PK_pbcatvld] PRIMARY KEY CLUSTERED
(
    [pbv_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

轉出過程中, 其實PD會產生insert 及update 語法, 所以上述五個table應設立PK或Unique Index,以避免重覆轉入

若手動修改了五個table的內容想要反向更新PDM時,則

Tools >> powerbuilder >>Reverse Engineering Extended Attributes...就轉回來了.

沒有留言:

張貼留言

自動記錄滑鼠點選操作

為了一個需求,需要人工去點選幾個滑鼠的點選行為,找了幾種工具,覺得GS Auto Clicker最實用,極符合我的需求,尤其是多個固定位置的button點擊,解決了一個很耗時間的工作。 最後設定完預設hotkey F8為啟用鍵,就可以開始自動做工了。再按F8結束工作。 GS Au...