Get the App
SLTechnology News&Howtos  ›  Database  › 

Example Analysis of Oracle PL/SQL Compiler warning PLSQL_WARNINGS

Shulou Source: shulou.com Published: 2022-05-31 12:39:57 11月13日 Update

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!

Tags: Compile sample analyze article done performance more message knowledge program industry information information channel channel control Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Huawei MariaDB Docker Shulou Tech Info