--ALTER TABLE C##AD.HIS_TABLE DROP PRIMARY KEY CASCADE;
--DROP TABLE C##AD.HIS_TABLE CASCADE CONSTRAINTS;
CREATE TABLE C##AD.HIS_TABLE
(
HIS_TABLE_ID NUMBER(10) NOT NULL,
HIS_TABLE_UU NVARCHAR2(36) DEFAULT NULL,
AD_CLIENT_ID NUMBER(10) NOT NULL,
AD_ORG_ID NUMBER(10) NOT NULL,
ISACTIVE CHAR(1 BYTE) DEFAULT 'Y' NOT NULL,
CREATED DATE DEFAULT SYSDATE NOT NULL,
CREATEDBY NUMBER(10) NOT NULL,
UPDATED DATE DEFAULT SYSDATE NOT NULL,
UPDATEDBY NUMBER(10) NOT NULL,
NAME NVARCHAR2(60) NOT NULL,
DESCRIPTION NVARCHAR2(255),
HELP NVARCHAR2(2000)
);
CREATE UNIQUE INDEX C##AD.HIS_TABLE_UU_IDX ON C##AD.HIS_TABLE(HIS_TABLE_UU);
CREATE UNIQUE INDEX C##AD.HIS_TABLE_KEY ON C##AD.HIS_TABLE(HIS_TABLE_ID);
ALTER TABLE C##AD.HIS_TABLE ADD (
CHECK (IsActive in ('Y','N')) ENABLE VALIDATE,
CONSTRAINT HIS_TABLE_KEY PRIMARY KEY (HIS_TABLE_ID)
USING INDEX C##AD.HIS_TABLE_KEY ENABLE VALIDATE);
沒有留言:
張貼留言