Created
May 18, 2016 13:56
-
-
Save hackvan/dd5f893f771559ee7493d7cd4df991a5 to your computer and use it in GitHub Desktop.
PL/SQL Oracle: Ejemplo con el uso del "Pragma Exception_Init"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Or Replace Procedure do_something(pevc_codbanco In Varchar2) Is | |
row_locked Exception; | |
Pragma Exception_Init(row_locked, -54); -- ORA-00054: recurso ocupado y obtenido con NOWAIT especificado o timeout vencido | |
Begin | |
For cc In (Select codbanco From sfcp005t Where codbanco = pevc_codbanco For Update Nowait) Loop | |
Exit; | |
End Loop; | |
Exception | |
When row_locked Then | |
raise_application_error(-20001, 'this row is locked...', False); | |
-- Raise Application with True show the ORA-00054 | |
-- Raise Application with False hide the ORA-00054 | |
End do_something; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment