Code Conversion - Oracle Performance Review Messages¶
SSC-PRF-OR0001¶
Package cursor FETCH uses PACKAGE_CURSOR.FETCH_CURSOR — stored procedure overhead per invocation.
Description¶
SnowConvert AI emits this review because each generated PACKAGE_CURSOR.FETCH_CURSOR call invokes an internal stored procedure and adds per-call overhead. Review fetches inside loops and increase limit_per_fetch when the consuming logic can process rows in batches.
Code Example¶
Input Code:¶
Oracle¶
Output Code:¶
Snowflake¶
Best Practices¶
- Set
limit_per_fetchto a value greater than 1 when the consuming logic can process rows in batches. - Review package cursor fetches inside loops because each generated helper invocation executes a stored procedure.
- For additional assistance, please email us at aim-support@snowflake.com.
SSC-PRF-OR0002¶
The generated DBMS_OUTPUT helper logs to a table on each call, which may impact performance.
Description¶
Snowflake has no native equivalent of Oracle’s DBMS_OUTPUT server-side buffer. To preserve diagnostic output, SnowConvert AI translates DBMS_OUTPUT calls to generated helper procedures (DBMS_OUTPUT.PUT_LINE_UDP, DBMS_OUTPUT.PUT_UDP, and DBMS_OUTPUT.NEW_LINE_UDP) that write each message to a logging table.
Because every call performs a table write, using DBMS_OUTPUT inside loops or high-frequency code paths can noticeably impact performance. This message is emitted so that diagnostic output calls that are not required in Snowflake can be removed. It replaces the previous SSC-FDM-OR0035 marker on these calls, and PUT / NEW_LINE no longer emit SSC-EWI-OR0076.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
- Remove
DBMS_OUTPUTcalls that were used only for debugging or tracing and are not required in the migrated code. - Where diagnostic output must be kept, avoid placing
DBMS_OUTPUTcalls inside loops or frequently executed branches to minimize the per-call table writes. - For additional assistance, please email us at snowconvert-support@snowflake.com.
SSC-PRF-OR0003¶
BULK COLLECT translated to ARRAY_AGG materializes the entire result set into a single ARRAY.
Description¶
SnowConvert AI translates BULK COLLECT to ARRAY_AGG, which materializes the full result set in one array. Review the expected row volume and bound or batch the query when the array could approach Snowflake variable limits.
Code Example¶
Input Code:¶
Oracle¶
Output Code:¶
Snowflake¶
Best Practices¶
- Bound the source query when the result set can be large, or process rows in smaller batches.
- Test representative volumes and monitor the generated array’s memory requirements.
- For additional assistance, please email us at aim-support@snowflake.com.