Example Analysis of Oracle PL/SQL Compiler warning PLSQL_WARNINGS
Xiaobian to share with you Oracle PL/SQL compilation warning PLSQL_WARNINGS example analysis, I hope you have something to gain after reading this article, let's discuss it together!
Three warning categories
1. SEVERE: Check for unexpected results, e.g. alias problems with parameters
2. PERFORMANCE: Performance issues, e.g. VARCHAR2 type provided for column NUMBER in insert
3. INFORMATINAL: Dead Code
Control warning messages (PLSQL_WARNINGS)
The default parameter is PLSQL_WARNINGS='DISABLE:ALL'
Example:
alter session set PLSQL_WARNINGS='ENABLE:INFORMATIONAL';
CREATE OR REPLACE PROCEDURE DEAD_CODE IS
DD VARCHAR2(22);
BEGIN
IF 2>1 THEN
DD:='1';
ELSE --Dead Code
DD:='2';
END IF;
END;
There will be warnings when compiling:
[Warning] PLW-06002 (7: 9): PLW-06002: Unable to execute code
After reading this article, I believe you have a certain understanding of "Oracle PL/SQL Compilation Warning PLSQL_WARNINGS Sample Analysis". If you want to know more about this knowledge, please pay attention to the industry information channel. Thank you for reading!