日期:2014-05-16 浏览次数:20448 次
--子TYPE CREATE OR REPLACE TYPE RSS_STR_OBJECT_TYPE IS OBJECT ( str_value varchar2(200) ); grant Execute on rssdata.RSS_STR_OBJECT_TYPE to rssopr; grant execute on rssdata.RSS_STR_OBJECT_TYPE to r_rssdata_Exec; --父TYPE代码 CREATE OR REPLACE TYPE RSS_STR_OBJECT_TYPE_LIST IS TABLE OF rssdata.RSS_STR_OBJECT_TYPE grant Execute on rssdata.rss_str_object_type_list to rssopr; grant execute on rssdata.rss_str_object_type_list to r_rssdata_Exec;
PROCEDURE rss_test_type_list_pro(in_rss_str_object_type_list IN rss_str_object_type_list, out_retcode OUT Varchar2, out_message OUT Varchar2) IS i NUMBER; begin LOOP i := in_rss_str_object_type_list.first; INSERT INTO TEST (D) VALUES (in_rss_str_object_type_list(i).str_value); EXIT WHEN i = in_rss_str_object_type_list.last; i := in_rss_str_object_type_list.next(i); END LOOP; EXCEPTION WHEN OTHERS THEN out_retcode := '9'; out_message := '[rss_test_type_list_pro]错误信息' || SQLCODE || ',' || SUBSTR(SQLERRM, 1, 120); END rss_test_type_list_pro;
declare -- 首先初始化这个需要测试的对象 创建一个对象 in_rss_str_object_type_list rss_str_object_type_list:= rss_str_object_type_list(); -- 再对其中需要测试的一个集合变量m1赋值 in_rss_str_object_type_m1 rss_str_object_type := rss_str_object_type('深圳常兴支行'); begin -- 调用存储过程的时候开始 in_rss_str_object_type_list.extend(); --将成员m1赋值给集合的最后一个元素 in_rss_str_object_type_list(in_rss_str_object_type_list.last) := in_rss_str_object_type_m1; rss_test.rss_test_type_list_pro(in_rss_str_object_type_list => in_rss_str_object_type_list, out_retcode => :out_retcode, out_message => :out_message); end;