//创建user 表
drop table t_user;
drop sequence s_user;
drop trigger tri_user;
create table t_user(
id number(4) primary key,
username varchar2(10) unique not null,
password varchar2(50) not null,
email varchar2(50),
phone varchar2(50),
question varchar2(50),
answer varchar2(50),
role number(4),
create_time date,
update_time date
);
create sequence s_user;
create trigger tri_user before
insert on t_user for each row when (new.id is null)
begin
select s_user.nextval into:new.id from dual;
end;
/
插入一行
insert into t_user (username,password,email,phone,question,answer,role,create_time,update_time) values ('wl2','123','3785@qq.com','1526113','我帅吗','帅',1,to_date('2018-08-06','YYYY-MM-DD'),sysdate)
版权归属:
王小木人个人技术文章记录
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区