--create trigger
create or replace trigger tri_configurate_person --triggername
before insert on configurate_person --table name
for each row--循环添加
declare
begin
if :new.configurate_id is null then --判断主键id是否为空
:new.configurate_id:=sys_guid();--设置uuid
end if;
if :new.create_time is null then--判断创建时间是否为空
:new.create_time:=SYSDATE();--创建当前系统时间
end if;
end tri_configurate_person;
注意:new 后面是自己的字段名
建表语句
-- Create table
create table test1111
(
id VARCHAR2(64) not null,
test1111 VARCHAR2(64),
test1111 VARCHAR2(64),
test1111 VARCHAR2(64),
test1111 VARCHAR2(5),
test1111 VARCHAR2(5),
create_time DATE
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column ivr_login.id is '主键id';
comment on column ivr_login.test1111 is '姓名';
comment on column ivr_login.test1111 is '密码';
comment on column ivr_login.test1111 is '工号';
comment on column ivr_login.test1111 is '角色等级,1:管理员 2:一级客户经理 3:';
comment on column ivr_login.is_login is '是否退出';
comment on column ivr_login.create_time is '创建时间';