开发者社区> 问答> 正文

How can a name be assigned to an unnamed PL/SQL ..

已解决

How can a name be assigned to an unnamed PL/SQL Exception Block?

展开
收起
1780169608831412 2021-10-16 18:03:36 512 0
1 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。
    采纳回答

    This can be done by using Pragma called EXCEPTION_INIT.

    This gives the flexibility to the programmer to instruct the compiler to provide custom error messages based on the business logic by overriding the pre-defined messages during the compilation time.

    Syntax:

    DECLARE 
      exception_name EXCEPTION; 
      PRAGMA EXCEPTION_INIT (exception_name, error_code); 
    BEGIN 
    // PL/SQL Logic
    EXCEPTION
     WHEN exception_name THEN
        // Steps to handle exception
    END;
    
    2021-10-16 18:16:28
    赞同 2 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
SQL Server 2017 立即下载
GeoMesa on Spark SQL 立即下载
原生SQL on Hadoop引擎- Apache HAWQ 2.x最新技术解密malili 立即下载