You should use the APPCORE package APP_EXCEPTION to raise exceptions in the PL/SQL procedures written for your forms.
| Summary | procedure APP_EXCEPTION.RAISE_EXCEPTION( exception_type varchar2 default null, exception_code number default null, exception_text varchar2 default null); |
| Location | APPCORE library and database (stored procedure) |
| Description | This procedure stores exception information and raises exception form_trigger_failure. |
| exception_text | Additional context information. |
| exception_type | Error prefix that specifies error type (for example, ORA or APP) |
| exception_code | The number that identifies the error. |
| Summary | procedure APP_EXCEPTION.RETRIEVE; |
| Location | APPCORE library and database (stored procedure) |
| Description | This procedure retrieves exception information from the database. |
| Summary | function APP_EXCEPTION.GET_TYPE return varchar2; |
| Location | APPCORE library and database (stored function) |
| Description | This function returns the exception type. |
| Summary | function APP_EXCEPTION.GET_CODE return number; |
| Location | APPCORE library and database (stored function) |
| Description | This function returns the exception code. |
| Summary | function APP_EXCEPTION.GET_TEXT return varchar2; |
| Location | APPCORE library and database (stored function) |
| Description | This function returns the exception text. |
| Description | This is a predefined exception. Call it in an exception handler to handle cases where the record cannot be locked. It is usually used with the APP_EXCEPTION.RECORD_LOCK_ERROR procedure. |
| Summary | procedure APP_EXCEPTION.RECORD_LOCK_ERROR ( counter IN OUT number); |
| Description | This procedure asks the user to continue or cancel an attempt to lock a record. It returns to the calling procedure to try again if the user continues. It displays an "Unable to reserve record" acknowledgement and raises FORM_TRIGGER_FAILURE if the user cancels. APP_EXCEPTION.RECORD_LOCK_ERROR only asks the user every two attempts to lock a record (e.g., counter = 2, 4, 6, etc.). The calling procedure should attempt to lock the record in a loop and call RECORD_LOCK_ERROR in a WHEN APP_EXCEPTION.RECORD_ LOCK_EXCEPTION exception handler inside the loop. If the user continues, RECORD_LOCK_ERROR returns and the loop repeats. If the user cancels, RECORD_LOCK_ERROR raises FORM_TRIGGER_FAILURE and the loop exits. |
| counter | Maintained by RECORD_LOCK_ERROR to count the attempts to lock a record. Calling procedure should initialize to null or 0. |
| Summary | procedure APP_EXCEPTION.DISABLED; |
| Description | This procedure rings the bell. Call this procedure to disable simple functions (typically in a KEY- trigger). |