手机版
你好,游客 登录 注册
背景:
阅读新闻

查看PL/SQL编译时的错误信息

[日期:2011-11-01] 来源:Linux社区  作者:robinson_0612 [字体:大 中 小]
二、捕获编译错误
    1、使用show errors捕获错误   
  1. SQL> show errors;                                                                 
  2. No errors.                                                                        
  3.                                                                                   
  4. SQL> show errors package body "OTC_WRHS_POSITION"."OTC_WRHS_POSITION_PCK_tmp";    
  5. No errors. 

    2、如果使用show errors无法查询到错误,直接查询视图dba_errors   

  1. SQL> desc dba_errors;                                                                                                     
  2. Name           Type           Nullable Default Comments                                                                   
  3. -------------- -------------- -------- ------- ---------------------------------------------------------------             
  4. OWNER          VARCHAR2(30)                                                                                               
  5. NAME           VARCHAR2(30)                    Name of the object                                                         
  6. TYPE           VARCHAR2(12)   Y                Type: "TYPE", "TYPE BODY", "VIEW", "PROCEDURE", "FUNCTION",                
  7. "PACKAGE", "PACKAGE BODY", "TRIGGER",                                                                                     
  8. "Java SOURCE" or "JAVA CLASS"                                                                                             
  9. SEQUENCE       NUMBER                          Sequence number used for ordering purposes                                 
  10. LINE           NUMBER                          Line number at which this error occurs                                     
  11. POSITION       NUMBER                          Position in the line at which this error occurs                            
  12. TEXT           VARCHAR2(4000)                  Text of the error                                                          
  13. ATTRIBUTE      VARCHAR2(9)    Y                                                                                           
  14. MESSAGE_NUMBER NUMBER         Y                                                                                           
  15.                                                                                                                           
  16. SQL> select owner,name,TEXT from dba_errors where owner='OTC_WRHS_POSITION' and name='OTC_WRHS_POSITION_PCK_tmp' and      
  17.   2  sequence=(select max(sequence) from dba_errors where owner='OTC_WRHS_POSITION');                                     
  18.                                                                                                                           
  19. OWNER                NAME                      TEXT                                                                       
  20. -------------------- ------------------------- ------------------------------------------------------------                
  21. OTC_WRHS_POSITION    OTC_WRHS_POSITION_PCK_tmp PLS-00103: Encountered the symbol "ULL" when expecting one o               
  22.                                                f the following:                                                           
  23.                                                                                                                           
  24.                                                   . ( ) , * @ % & = - + < / > at in is mod remainder not re               
  25.                                                m                                                                          
  26.                                                   <an exponent (**)> <> or != or ~= >= <= <> and or like LI               
  27.                                                KE2_                                                                       
  28.                                                   LIKE4_ LIKEC_ between || multiset member SUBMULTISET_                   
  29.                                                The symbol "." was substituted for "ULL" to continue.      
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款