oracle上机1及答案,Oracle上机考试最后答案

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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值