storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- 序列
create sequence customerIDKey
minvalue 1
maxvalue 999999999999
start with 1
increment by 1;
--触发器 create or replace trigger customerID_trigger
BEFORE
INSERT
on CUSTOMERS
for each row
declare
nextNumber int;
begin
select customeridkey.nextval into nextNumber from dual;
:new.customerid:=nextNumber;
end;
--测试
insert into customers values(0,'任新林','北京海淀','北京','010526798774','CSS', to_date('04-03-1986', 'dd-mm-yyyy'),1);
insert into customers values(0,'Ryan','北京朝阳','北京','010526798994','GWSSI', to_date('04-03-1986', 'dd-mm-yyyy'),1);
3.编写一存储过程使其能在customers表中插入数据,并做测试。(20). CREATE OR REPLACE PROCEDURE add_customer
(name http://www.1mpi.com%type,
address customers.address%type,
city customers.city%type,
tel customers.tel%type,
company http://www.1mpi.company%type,
birthday customers.birthday%type,
type customers.type%type default 1)
IS
e_integrity EXCEPTION;
pragma EXCEPTION_INIT(e_integrity,-01400);
BEGIN
INSERT INTO customers(name,address,city,tel,company,birthday,type)