zoukankan      html  css  js  c++  java
  • 编译后错误提示为pls-00103:出现符号""在需要下列之一时:begin case declare

    转自:https://www.cnblogs.com/songdavid/archive/2011/09/13/2174908.html

    create or replace trigger auth_secure
     before insert or update or delete --/对整表更新前触发
      on g002
    begin
     IF to_char(sysdate,'DY','nls_date_language=american')
    in ('THU') then
    Raise_application_error(-20001, 'ou dont have access to modify this table.');
     End if;
    End ;

    编译后错误提示为:
    5 pls-00103:出现符号""在需要下列之一时:begin case declare exit for goto if loop mod null pragma raise return select update while with ...
    8 pls-00103:出现符号""在需要下列之一时:begin case declare else elseif end exit for goto if loop mod null pragma raise return select update while with ...

    原因分析:

    肉眼看不到的,有可能是全角的空格
    create or replace trigger auth_secure
     before insert or update or delete --/对整表更新前触发
      on g002
    begin
    IF to_char(sysdate,'DY','nls_date_language=american') --前面可能是全角的空格
    in ('THU') then
    Raise_application_error(-20001, 'ou dont have access to modify this table.');
    End if; --前面可能是全角的空格
    End ;

    这行代码前IF to_char(sysdate,'DY','nls_date_language=american')
    有两个不可见的控制符(看似空格,其实编码为A1,十进制161),这是导致编译错误的原因
    同样语句End if; 前面也有两个。
    删除后应该编译OK
    不知在什么地方复制的

    解决办法:

    因为是从别处复制的代码,可能有非法字符,删除了重新写一遍就可以了!

  • 相关阅读:
    Unity Ply网格读取
    LoadLibrary加载dll失败
    Anaconda引起cuda MSB3721 with return error code 1
    STL 如何对STL进行扩展,简单小结
    集群环境准备(Centos7)
    MySQL中的常见函数
    Mysql优化_第十三篇(HashJoin篇)
    docker创建和使用mysql
    JNI相关笔记 [TOC]
    选择排序
  • 原文地址:https://www.cnblogs.com/bibi-feiniaoyuan/p/13198788.html
Copyright © 2011-2022 走看看