下面这里面红色的字体都是干什么用的啊????
CREATE OR REPLACE PACKAGE TOS_SP_AGENTMSTVERSSC
AS
TYPE AssocArrayChar_t IS TABLE OF CHAR INDEX BY BINARY_INTEGER;
TYPE CursorType IS REF CURSOR;
TYPE AssocArrayVarchar2_t IS TABLE OF VARCHAR2(1024) INDEX BY BINARY_INTEGER;
TYPE AssocArrayNVarchar2_t IS TABLE OF NVARCHAR2(1024) INDEX BY BINARY_INTEGER;
TYPE AssocArrayDate_t IS TABLE OF DATE INDEX BY BINARY_INTEGER;
PROCEDURE GET_AGENTMSTVERS(v_agent_classvers IN VARCHAR2, v_seq IN VARCHAR2, v_facility_type_id IN VARCHAR2, v_withdata IN VARCHAR2, RefCur_MasterBO OUT CursorType, v_totalCount OUT VARCHAR2);
PROCEDURE SET_AGENTMSTVERS(
V_AGENT_CLASS IN AssocArrayVarchar2_t,
V_NEW_AGENT_CLASS IN AssocArrayVarchar2_t,
V_SEQ IN AssocArrayVarchar2_t,
V_NEW_SEQ IN AssocArrayVarchar2_t,
V_CREATE_DTIME IN AssocArrayDate_t,
V_CREATE_STAFF_ID IN AssocArrayVarchar2_t,
V_CREATE_STAFF_NAME IN AssocArrayNVarchar2_t,
V_FACILITY_TYPE_ID IN AssocArrayVarchar2_t,
V_UN_AGENT_CLASS IN AssocArrayVarchar2_t,
V_UPDATE_DTIME IN AssocArrayDate_t,
V_UPDATE_STAFF_ID IN AssocArrayVarchar2_t,
V_UPDATE_STAFF_NAME IN AssocArrayNVarchar2_t,
V_ACTIONFLAG IN AssocArrayChar_t,
RegistrationType IN VARCHAR2,
ErrorInfo OUT CLOB,
SystemDate OUT DATE
) ;
END;
------解决方案--------------------
加了”index by binary_integer ”后,类型的下标就是自增长,不需要初始化,不需要每次extend增加一个空间,而如果没有这句话“index by binary_integer”,那就得要显示对初始化,且每插入一个元素到table中时,都需要先extend
------解决方案--------------------定义不同的变量啊
------解决方案--------------------自定义数据类型,变量在声明的时候就可以声明为这个类型的,就像变量声明为某个表的某个字段类型一样。
------解决方案--------------------
自定义数据类型,也叫ORACLE数据库对象。 像其他面向对象语言一样,ORACLE数据库对象也包括属性和方法。
语法:
create type type_name as object (a number,b varchar2(10),member function c return date);
而这个存储过程中的index by binary_integer,请看http://hi.baidu.com/hanbingxiaoshi/item/96ec1b2e4102120c72863eae