Created
February 23, 2017 16:53
-
-
Save hackvan/1f20c7bd042045bd7901cc3c45d55aa0 to your computer and use it in GitHub Desktop.
How to create a custom exception for the use of CURRVAL on sequences.
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
Declare | |
nextvalnotfound Exception; | |
Pragma Exception_Init(nextvalnotfound, -08002); | |
lc_secuencia Number; | |
Begin | |
SELECT sfps010s.currval INTO lc_secuencia FROM dual; | |
Exception | |
When nextvalnotfound Then | |
dbms_output.put_line('NextVal is not found it!'); | |
When Others Then | |
dbms_output.put_line('Error: ' || Sqlerrm); | |
End; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment