当前位置:首页 > 数据库 > 数据库

札记1触发器与序列号

优良自学吧提供札记1触发器与序列号,笔记1触发器与序列号 create index PATCOSDATA.ix_type_visitname on PATCOSDATA.PATCOS_BACKVISIT_TYPE (VISIT_TYPE_NAME); cre

笔记1触发器与序列号

create index PATCOSDATA.ix_type_visitname on PATCOSDATA.PATCOS_BACKVISIT_TYPE (VISIT_TYPE_NAME);

create index PATCOSDATA.ix_type_visitcode on PATCOSDATA.PATCOS_BACKVISIT_TYPE (VISIT_TYPE_CODE);

--create synonym

create public synonym PATCOS_BACKVISIT_TYPE for PATCOSDATA.PATCOS_BACKVISIT_TYPE;

create public synonym backvisit_code_autoinc for PATCOSDATA.backvisit_code_autoinc;

drop sequence backvisit_code_autoinc;

create sequence backvisit_code_autoinc

minvalue 1

maxvalue 999999

start with 1

increment by 1

nocache;

create or replace trigger insert_backvisit_type_autoinc

before insert on PATCOSDATA.PATCOS_BACKVISIT_TYPE

for each row

begin

select backvisit_code_autoinc.nextval into :new.VISIT_TYPE_CODE from dual;

end insert_backvisit_type_autoinc;


(本文来自互联网,不代表搜站(http://www.ylzx8.cn/)的观点和立场)
本站所有内容来自互联网,若本站收录的信息无意侵犯了贵司版权,请给我们来信(ylzx8cn@163.com),我们会及时处理和回复,谢谢