标签:
1 test
2
----包 create or replace package test_pkg1 is procedure test_p(v_id in sys_user.id%type, v_name in sys_user.name%type, msg out varchar); end test_pkg1; -- 包体 create or replace package body test_pkg1 is procedure test_p(v_id in sys_user.id%type, v_name in sys_user.name%type, msg out varchar) is v_t_id number; v_t_name sys_user.name%type; ---游标 cursor cor1 is select p.id, p.name from sys_user p; begin open cor1; loop fetch cor1 into v_t_id, v_t_name; exit when cor1%notfound; dbms_output.put_line(v_t_id || ‘ - ‘ || v_t_name); msg := msg || v_t_name; end loop; close cor1; end test_p; end test_pkg1; declare v_msg varchar2(500); begin test_pkg1.test_p(23, ‘test‘, v_msg); dbms_output.put_line(v_msg); end; -----
3
标签:
原文地址:http://my.oschina.net/xwl1990/blog/527458