Oracle 表脚本备忘

 

DROP TABLE "TASKITEM";

CREATE TABLE "TASKITEM"
("TASKITEMID" NUMBER NOT NULL ENABLE,
"MODIFYCOUNT" NUMBER DEFAULT 0,
"SYSTEMGROUPID" NUMBER DEFAULT 0 NOT NULL ENABLE,
"DESCRIPTION" VARCHAR2(400),
"MAKERUSERID" NUMBER DEFAULT 0 NOT NULL ENABLE,
"PLANENDDATE" DATE,
"ACTUALENDDATE" DATE,
"MADETIME" DATE,
"REMINDTIME" DATE,
"DROPTIME" DATE,
"STATUS" NUMBER DEFAULT 1,
"ANNOTATION" VARCHAR2(400),
"TASKACCEPTANCETYPEID" NUMBER DEFAULT 0 NOT NULL ENABLE,
"ISIMPORTANT" NUMBER DEFAULT 0 NOT NULL ENABLE,
"ASPID" NUMBER DEFAULT 0 NOT NULL ENABLE,
"TASKLEADER" NUMBER DEFAULT 0,
"PERSONALAPPROVE" NUMBER DEFAULT 0,
"DEPARTMENTAPPROVE" NUMBER DEFAULT 0,
"COMPANYAPPROVE" NUMBER DEFAULT 0,
"MODIFIER" NUMBER DEFAULT 0,
"DELAYDAYS" NUMBER DEFAULT 0,
"ANNOTATION1" VARCHAR2(400),
"ANNOTATION2" VARCHAR2(400),
"ANNOTATION3" VARCHAR2(400),
"ANNOTATION4" VARCHAR2(400),
"ANNOTATION5" VARCHAR2(400),
"VISIBLE" NUMBER DEFAULT 1 NOT NULL ENABLE,
"ASSISTMANAGERAPPROVE" NUMBER DEFAULT 0 NOT NULL ENABLE,
"MONTHITEMID" NUMBER DEFAULT 0 NOT NULL ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS"
;

--创建序列

CREATE SEQUENCE "SU_TASKITEM" INCREMENT BY 1 START WITH 1 MAXVALUE 1.0E27
MINVALUE 1 NOCYCLE CACHE 20 ORDER;

-- ----------------------------
--
创建触发器(主键自增)
--
----------------------------
CREATE OR REPLACE TRIGGER "TU_TASKITEM" BEFORE INSERT ON "TASKITEM" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW
BEGIN IF :new.TASKITEMID IS NULL THEN
SELECT SU_TASKITEM.NEXTVAL INTO :new.TASKITEMID
FROM dual;
END IF;
END;;

 

转载于:https://www.cnblogs.com/archie2010/archive/2011/10/30/2229101.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值