Oracle table script memo

Source: Internet
Author: User

 

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,
"Your managerapprove" 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

Create sequence "su_taskitem" increment by 1 start with 1 maxvalue 1.0e27
Minvalue 1 nocycle cache 20 order;

------------------------------
-- Create a trigger (primary key auto-increment)
------------------------------
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 ;;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.