Purpose
To inform Migration Engineers of a change that needs to be made to stored procedures that have cursor processing. Specically the change is for the cursor processing loop to test for CURSORNAME%FOUND instead of STO_FETCHSTATUS.
Scope & Application
The audience for this document is Oracle Customers, Oracle Partners and Oracle Migration Specialists that are using the Migration Workbench to migrate Sybase or SQL Server stored procedures to Oracle.
STO_FETCHSTATUS Changed To CURSORNAME%FOUND
The if statement logic used to set the StoO_fetchstatus variable complicates code. Its much easier to use <cursor_name>%FOUND to check if there are still rows in the cursor to process.

Note: The IF statement logic, is repeated after each fetch of the cursor. The If statement logic used to change the value of StoO_fetchstatus and is not needed and can be removed.

Before After
IF FY_cursor%NOTFOUND THEN
StoO_sqlstatus := 2;
StoO_fetchstatus := -1;
ELSE
StoO_sqlstatus := 0;
StoO_fetchstatus := 0;
END IF;
<<i_loop1>>
WHILE StoO_fetchstatus = 0 LOOP
WHILE FY_cursor%FOUND LOOP
Related Documents
<>STO_FETCHSTATUS Should Be Changed To CURSORNAME%FOUND
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy