17,140
社区成员




declare
n_cnt number;
n_index number;
begin
/*==============================================================*/
/* Table: TB_PERIOD */
/*==============================================================*/
execute immediate 'create table TB_PERIOD (
periodid NUMBER(20,0) not null,
periodname VARCHAR2(10) not null unique,
constraint PK_TB_PERIOD primary key (periodid)
)';
execute immediate 'comment on table TB_PERIOD is '||''''||'档案年度 '||''''||'';
execute immediate 'comment on column TB_PERIOD.periodid is '||''''||'年度ID '||''''||'';
execute immediate 'comment on column TB_PERIOD.periodname is '||''''||'档案年度 '||''''||'';
execute immediate 'create sequence SQ_TB_PERIOD
minvalue 1
maxvalue 2147483647
start with 1
increment by 1
nocache
order';
execute immediate 'create or replace trigger TRIGGER_TB_PERIOD
before insert
on TB_PERIOD
for each row
begin
select SQ_TB_PERIOD.nextval
into :new.periodid
from dual;
end;';
end;