日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

powerdesigner 设置唯一约束

發(fā)布時間:2023/12/15 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 powerdesigner 设置唯一约束 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

者:yan


代碼生成:

/*==============================================================*/
/* Index: "UQ_providerid" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? */
/*==============================================================*/
create unique index "UQ_providerid" on "tab" (
? ?"xx" ASC,
? ?"xxx" ASC,
? ?"xxxx" ASC,
? ?"xxxxx" ASC
);





代碼生成:

/*==============================================================*/
/* Table: "jg_emp_jobgrade" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? */
/*==============================================================*/
create table "jg_emp_jobgrade" ?(
? ?"id" ? ? ? ? ? ? ? ? CHAR(32) ? ? ? ? ? ? ? ? ? ? ? ?not null,
? ?"emp_id" ? ? ? ? ? ? CHAR(32),
? ?"jg_id" ? ? ? ? ? ? ?CHAR(32),
? ?"jobfamily_branch_id" CHAR(32),
? ?"job_grade" ? ? ? ? ?varchar(32),
? ?constraint PK_JG_EMP_JOBGRADE primary key ("id"),
? ?constraint AK_KEY_2_JG_EMP_J unique ("emp_id", "jg_id", "jobfamily_branch_id")

);





Oracle?10g中unique與index的問題

create table test

(

? x integer,

? y integer,

? z integer

);

alter table test add constraint primary key (x); --產(chǎn)生一個約束,并產(chǎn)生一個同名索引

create unique index index01 on test(x,y);

--create unique index index02 on test(x,y); --不允許完全相同的索引,即使索引名稱不同

create unique index index03 on test(y,z);

create unique index index04 on test(z,y); --index04 是與index03互不相同的索引

alter table test add constraint cons01 unique(x,y,z) ; --產(chǎn)生一個約束,并自動產(chǎn)生一個名為cons01 的UNIQUE索引

alter table test add constraint cons01 unique(x,y) ; --產(chǎn)生一個約束,但因與index01 重復(自動產(chǎn)生的索引不區(qū)分順序),因此不能自動產(chǎn)生索引

alter table test add constraint cons01 unique(y,x) ; --產(chǎn)生一個約束,但因與index01 重復,因此不能自動產(chǎn)生索引

--create unique index cons01 on test(x,y);? --不能執(zhí)行,因為索引cons01 已經(jīng)被約束cons01 自動創(chuàng)建的索引占用

alter table test add constraint cons012 check (x>100);
alter table test add constraint cons013 check (x>100);? --check可以內(nèi)容完全相同

處理辦法:

提取所有約束(UCPR)

提取名稱不在約束表中的所有索引


總結(jié)

以上是生活随笔為你收集整理的powerdesigner 设置唯一约束的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。