Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle universal stored procedure

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Create or replace procedure proc_data_check is

-- define variables

V_LOCK_ID INTEGER

V_lockhandle VARCHAR (128)

V_RELEASE_ID INTEGER

-- define error exception information coding

V_error_code VARCHAR2 (10): =''

-- define 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 exception coding

V_ERROR_CODE: = SQLCODE

-- get exception description information

V_ERROR_MESSAGE: = SQLERRM

-- maintain exception information in the exception table

End proc_data_check

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report