By Bill Ramos and Ankit Matta, Advaiya Inc.
This blog post covers the reason why SQL Server Migration Assistant (SSMA) for Oracle cannot convert EXCEPTION_INIT.
Exception handling is a programming language construct or mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution. One can use the pragma EXCEPTION_INIT to associate exception names with other Oracle error codes that one can anticipate. Once you know the error code, you can use it with pragma EXCEPTION_INIT and write a handler specifically for that error.
Error O2SS0055 Incorrect EXCEPTION_INIT PRAGMA parameter
Whenever you try to convert PL/SQL code having a “PRAGMA EXCEPTION_INIT” exception without defining an error number in its parameter section, SSMA generates “Error O2SS0055 Incorrect EXCEPTION_INIT PRAGMA parameter” because it doesn’t find a numeric literal. It is mandatory to pass a negative number (i.e. the error number for which you want to throw this exception) in the parameter section.
Consider the following example:
PRAGMA EXCEPTION_INIT(MYEXCEPTION, ”);
When SSMA doesn’t find a numeric literal in the parameter section of PRAGMA EXCEPTION_INIT, SSMA generates the error “Error O2SS0055 Incorrect EXCEPTION_INIT PRAGMA parameter”.
Remediation of this error is to define an error number for which you want to throw this exception. For this, update the code as follows:
PRAGMA EXCEPTION_INIT(MYEXCEPTION, –10000);
SSMA will convert the updated code with no errors.
There are several other errors related to Exceptions that you may encounter. These include the following:
For more information, check out the following references: