Oracle Universal Stored Procedures

Source: Internet
Author: User

Create or replace procedure Proc_data_check is

    -- Defining Variables

V_LOCK_ID INTEGER;

V_lockhandle VARCHAR (128);

V_RELEASE_ID INTEGER;

    -- To define an error exception message encoding

V_error_code VARCHAR2 (10): = ";

    -- Defining Error Exception description information

V_error_message VARCHAR2 (1000): = ";

Cursor Check_orgs is

Select Org_code, org_name from check_org;

Begin

Dbms_lock. Allocate_unique (' Proc_data_check ', V_lockhandle, 86400);

v_lock_id: = Dbms_lock. REQUEST (V_lockhandle, Dbms_lock. X_mode, 0, FALSE);

if (v_lock_id = 0) Then

For check_org in Check_orgs loop

Null

End Loop;

v_release_id: = Dbms_lock.release (V_lockhandle);

COMMIT;

End If;

Commit

EXCEPTION

When OTHERS Then

v_release_id: = Dbms_lock.release (V_lockhandle);

    -- get the exception code

V_error_code: = SQLCODE;

    -- Get exception description information

V_error_message: = SQLERRM;

    -- maintaining exception information in the exception table

End Proc_data_check;

This article from "Ko Fai blog" blog, reproduced please contact the author!

Oracle Universal Stored Procedures

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.