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.
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:
· Error O2SS0343 FORALL statement with SAVE EXCEPTION clause is not supported
· Error O2SS0054 Unable to convert EXCEPTION_INIT
For more information, check out the following references:
· Migrating Oracle to SQL Server 2008 White Paper