create sequence sep_employee_empid
increment by 1
start with 0
maxvalue 999
minvalue 0
nocache
cycle
--创建触发器
create trigger trg_employee
before insert
on tb_employee
for each row
declare
a number:=1000;
b number:=sep_employee_empid.nextval;
begin
select 'e'||to_char(a+b) into:new.empID from dual;
end;
报了个错
ORA-01008:并非所有变量都已绑定
------解决方案--------------------
-创建触发器
create trigger trg_employee
before insert
on tb_employee
for each row
declare
a number:=1000;
b number:=sep_employee_empid.nextval;
begin
select 'e'||to_char(a+b) into b from dual;
:new.empID := b ;
end;