CREATE OR REPLACE PACKAGE BODY get_form_no_pub IS /*==================================================================================================== 包入口 : 用途说明 : 取单据序号 创建者 : Leon.Duan 创建时间 : 2014/12/4 19:34:50 ====================================================================================================*/ PROCEDURE main(p_form_type IN VARCHAR2 --单据类型 ,p_form_date IN DATE --单据日期 ,p_org_id IN NUMBER DEFAULT NULL --库存组织ID ,x_ret_data OUT SYS_REFCURSOR) IS v_proc_name VARCHAR2(80); v_form_no VARCHAR(80); v_ret_code VARCHAR(80); v_ret_msg VARCHAR(4000); BEGIN v_proc_name := 'biz_get_form_no.main'; --调用单号产生函数 v_form_no := biz_get_form_no.main(p_form_type ,p_form_date ,p_org_id ,v_ret_code ,v_ret_msg); OPEN x_ret_data FOR SELECT v_form_no AS "FORM_NO" ,v_ret_code AS "RET_CODE" ,v_ret_msg AS "RET_MSG" FROM dual; EXCEPTION WHEN OTHERS THEN v_ret_code := '1'; v_ret_msg := SQLERRM || '(' || v_proc_name || ')'; v_form_no := ''; OPEN x_ret_data FOR SELECT v_form_no AS "FORM_NO" ,v_ret_code AS "RET_CODE" ,v_ret_msg AS "RET_MSG" FROM dual; END main; END get_form_no_pub;