Oralcel脚本创建
create or replace procedure init_table
as
v_count integer;
begin
select count(*) into v_count from user_tables where upper(table_name)=upper('T_BUSINESSENTITY');
if v_count > 0 then
execute immediate 'drop table T_BUSINESSENTITY';
end if;
select count(*) into v_count from user_sequences where upper(sequence_name)=upper('S_BME_USERLOG');
if v_count > 0 then
execute immediate 'drop sequence S_BME_USERLOG';
end if;
end;
/
execute init_table();
/
drop procedure init_table;
create sequence seq_t_resprompt minvalue 1000000000 maxvalue 99999999999 start with 1000000000 increment by 1 cache 20;
create or replace trigger tri_t_resprompt before insert on t_resprompt for each row when(new.respromptid is null) begin select seq_t_resprompt.nextval into:new.respromptid from dual;
end;