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.
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”
Consider the example below, in which we have created a package Empty_Pkg4 with invalid syntax:
CREATE OR REPLACE package Empty_Pkg4
PVT INT := 10;
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:
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.
For more information, check out the following references:
· Migrating Oracle to SQL Server 2008 White Paper