表结构重建
create procedure P_NOTIFYGRP
is
tmp_name VARCHAR2(50);
BEGIN
select table_name into tmp_name from user_tables where table_name='NOTIFYGRP';
if length(tmp_name)>0 then ?
? ? execute immediate 'drop table NOTIFYGRP cascade constraints';?
END if;
EXCEPTION
WHEN NO_DATA_FOUND THEN
? ? BEGIN
? ? ? ? NULL;
? ? END;
END;
/
exec P_NOTIFYGRP();
drop procedure P_NOTIFYGRP;
create table NOTIFYGRP
(
? ?NotifyGrpId ?NUMBER(10) ? NOT NULL,
? ?operator ? ? VARCHAR2(20) NOT NULL,
? ?GrpName ? ? ?VARCHAR2(20),
? ?NotifyMode ? VARCHAR2(1)
);
?
alter table NOTIFYGRP add constraint PK_NOTIFYGRP primary key (NotifyGrpId, operator);