您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
oracle-自定义数据类型
发布时间:2017-11-23 15:18:05编辑:雪饮阅读()
自定义记录类型
create or replace procedure p12(dpnum int) is
type dpinfo is record
(
dname varchar2(14),
loc varchar2(13),
cnt int,
sal number
);
dp dpinfo;
begin
select dname,loc into dp.dname,dp.loc from dept where deptno=dpnum;
select count(*),sum(sal) into dp.cnt,dp.sal from emp where deptno=dpnum;
dbms_output.put_line(dp.dname ||'__'||dp.loc||'__'||dp.cnt||'_'||dp.sal);
end;
/
自定义枚举类型
create procedure p13
is
type charset is table of char;
answ charset :=charset('a','b','c','d');
begin
dbms_output.put_line('has '||answ.count()||' option answer');
end;
关键字词:oracle,类型,自定义
上一篇:oracle-子查询
下一篇:oracle-附件