Migrating Oracle to SQL Server using SSMA - Error O2SS0418 Failed to parse statement batch with package definition
By Bill Ramos and Vishal Soni, Advaiya Inc.
This blog post describes why SQL Server Migration Assistant (SSMA) for Oracle doesn’t convert the PL/SQL block when using invalid syntax while creating a package in Oracle code.
Error O2SS0418 Failed to parse statement batch with package definition
Background
Whenever we used the invalid syntax while creating a package in Oracle code, SSMA generates following error: “Error O2SS0418 Failed to parse statement batch with package definition”
Possible Remedies
Consider the example below, in which we have created a package Empty_Pkg4 with invalid syntax:
CREATE OR REPLACE package Empty_Pkg4
IS
Begin
PVT INT := 10;
END;
When SSMA tries to convert the above statement, it generates following error: “Error O2SS0418 Failed to parse statement batch with package definition” .
To resolve this error, you can correct the source code and delete the invalid syntax in Oracle. In our example we have to delete the Begin statement from the Oracle source code as shown below:
CREATE OR REPLACE package Empty_Pkg4
IS
PVT INT := 10;
END;
When you convert the above code in SSMA, it converted successfully.
Another remedy to consider is verifying if any application code calls the package containing the invalid syntax. If not, consider removing the package from your migration project.
References
For more information, check out the following references: