首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

plsql 小问啼,该如何处理

2012-01-07 
plsql 小问啼DECLARETYPE staff IS TABLE OF employeestafferemployee//这里是啥意思。。。。FUNCTION new_h

plsql 小问啼
DECLARE
  TYPE staff IS TABLE OF employee;

  staffer employee;//这里是啥意思。。。。

  FUNCTION new_hires(hiredate DATE)
  RETURN staff IS
  BEGIN
  ...
  END;
BEGIN//怎么又有个begin
  staffer := new_hires('10-NOV-98')(5);
  ...
END; 
-----------------------
请问1 staffer employee;是啥意思呀?
怎么会有2个 begin呀、


[解决办法]
请问1 staffer employee;是啥意思呀?

staffer是自定义类型

employee是变量名

[解决办法]
怎么会有2个 begin呀、
一个begin是函数体的begin,第二个begin是pl程序块的begin 


[解决办法]
相当于java中的对象和实例的关系
[解决办法]

DECLARE
TYPE staff IS TABLE OF employee;
--employee是一个自定义类型,
--查一下定义select * from user_source t where t.name=upper('employee');

 --在声明部分声明一个函数
  FUNCTION new_hires(hiredate DATE)
RETURN staff IS
BEGIN
...
END;

--还可以声明其它变量等
  
BEGIN//怎么又有个 begin
staffer := new_hires('10-NOV-98')(5);
...
END;

热点排行