ORACLE syntax-package, procedure, cursor, and oraclecursor

Source: Internet
Author: User

ORACLE syntax-package, procedure, cursor, and oraclecursor
Example of Chen kichao: Packet Specification

Create or replace package PACK_WMS_YX IS -- Author: CKZ -- Created: 9:52:29 -- Purpose: synchronize data -- Public type declarations, CURSOR retirement order TYPE retCursor is ref cursor; -- RETURN vi_co_co_return % ROWTYPE; -- synchronize the return order and return the returned order list set cursor PROCEDURE sp_syn_returned (errno out number, errtext OUT VARCHAR2, outCursor OUT retCursor); END PACK_WMS_YX;
Package subject
Create or replace package body PACK_WMS_YX IS -- Author: CKZ -- Created: 9:52:29 -- Purpose: synchronize data -- Public variables declarations, execution status v_errorcode failed % TYPE; v_errormsg failed % TYPE; v_exception EXCEPTION; -- custom EXCEPTION -- synchronous return order PROCEDURE sp_syn_returned (errno out number, errtext OUT VARCHAR2, outCursor OUT retCursor) is begin errno: = 0; errtext: = 'success '; -- OPEN the cursor and obtain the OPEN outCursor for select co_num, cust_code, qty_sum, amt_sum, crt_date, born_date FROM cursor; EXCEPTION -- exception when others then rollback; v_errorcode: = SQLCODE; v_errormsg: = substr (SQLERRM, 200); errno: = 1; errtext: = v_errormsg; pack_wms_pub.sp_wms_insertSpErr ('synchronous return order, return order list curl', v_errorcode, v_errormsg ); END sp_syn_returned; BEGIN -- Initialization NULL; END PACK_WMS_YX;
Call example

Right-click the name of the stored procedure to be tested and choose Test.
The page is displayed.

Run Start debugger and Run

View cursor data

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.