OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Compile-time alerts

    Last Updated:2023-10-31 11:17:11  Updated
    share
    What is on this page
    PLSQL_WARNINGS parameters
    DBMS_WARNING package

    folded

    share

    When you compile stored PL units, the PL compiler issues warnings for operations that are not supported but will not cause errors or jeopardize the compilation. For example, an alert is generated if an obsolete PL feature is used.

    Applicability

    This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.

    PLSQL_WARNINGS parameters

    The PL alert messages are in the format of PLW-nnnnn.

    The following table describes the levels of compile-time alerts.

    Category
    Description
    Example
    SEVERE Alerts for issues that may lead to unexpected behaviors or invalid results. Parameter aliasing issues.
    PERFORMANCE Alerts for issues that may lead to performance deterioration. A VARCHAR2 value is passed to the NUMBER column in the INSERT statement.
    INFORMATIONAL Alerts for issues that do not affect performance or correctness but may require modifications to make the code easier to maintain. Non-executable code.

    You can achieve the following purposes by setting the compilation parameter PLSQL_WARNINGS:

    • Enable and disable all alerts, including alerts of one or more categories or specific alerts.

    • Treat a specific alert as an error that must be corrected before PL unit compilation.

    You can set the PLSQL_WARNINGS parameter for the following items by using different statements:

    • Database instances: Use the ALTER SYSTEM statement.

    • Sessions: Use the ALTER SESSION statement.

    • Stored PL units: Use the ALTER statement and compile_parameters_clause.

    All the foregoing ALTER statements use the following syntax to set the PLSQL_WARNINGS parameter:

    PLSQL_WARNINGS = 'value_clause [, value_clause] ...'
    

    The following are examples that use the ALTER statement to set the PLSQL_WARNINGS parameter.

    Example 1: Enable all alerts for the current session.

    ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';
    

    Example 2: Disable INFORMATIONAL alerts for the current session.

    ALTER SESSION SET PLSQL_WARNINGS='DISABLE:INFORMATIONAL';
    

    Example 3: Enable PERFORMANCE alerts, disable SEVERE alerts, and treat PLW-07002 alerts as errors for the session.

    ALTER SESSION
    SET PLSQL_WARNINGS='ENABLE:PERFORMANCE, DISABLE:SEVERE, ERROR:07002';
    

    DBMS_WARNING package

    To compile PL units in a development environment, call subprograms in the DBMS_WARNING package to display and set the PLSQL_WARNINGS parameter.

    When you compile complex programs, you can use the DBMS_WARNING subprogram to set different values for PLSQL_WARNINGS. The DBMS_WARNING subprogram can save the current settings of PLSQL_WARNINGS. You can modify the settings to compile a specified subprogram set and then restore the original values.

    Here is an example:

    obclient> ALTER SESSION SET PLSQL_WARNINGS='DISABLE:ALL'; -- Disable all alert messages for this session
    Query OK, 0 rows affected
    
    obclient> CREATE OR REPLACE PROCEDURE sample_code AUTHID DEFINER AS
      n CONSTANT BOOLEAN := TRUE;
    BEGIN
      IF n THEN
        DBMS_OUTPUT.PUT_LINE('TRUE');
      ELSE
        DBMS_OUTPUT.PUT_LINE('FALSE');
      END IF;
    END sample_code;
    /
    Query OK, 0 rows affected
    
    obclient> CALL DBMS_WARNING.set_warning_setting_string ('ENABLE:ALL', 'SESSION'); --Enable all alert messages for this session
    Query OK, 0 rows affected
    
    obclient> SELECT DBMS_WARNING.get_warning_setting_string() FROM DUAL; --View the current alert settings
    +-------------------------------------------+
    | DBMS_WARNING.GET_WARNING_SETTING_STRING() |
    +-------------------------------------------+
    | ENABLE:ALL                                |
    +-------------------------------------------+
    1 row in set
    

    Previous topic

    Overview
    Last

    Next topic

    Exception types
    Next
    What is on this page
    PLSQL_WARNINGS parameters
    DBMS_WARNING package