oracle 中怎么样去除关键字特殊意义?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle 中怎么样去除关键字特殊意义?相关的知识,希望对你有一定的参考价值。

create user order identified by bdqn 中order是关键字不能创建这个名字的用户,要怎么样去掉order的关键字属性?

参考技术A 打个双引号,
"order"
CREATE USER "order" identified by "123"本回答被提问者采纳
参考技术B 使用双引号,另外数据库中强烈不建议使用保留字和关键字作为对象名称。 参考技术C 你这个问题只能找ORACLE公司 参考技术D create user [order] identified by bdqn

oracle去除常见特殊字符方法

网上找了一大圈没找到想要的 于是自己手写了一份。有需要的朋友拿走,走前留个赞,谢谢。

create or replace function FUNC_STRING_CLEAN(data IN VARCHAR2) return varchar2
 IS
  data1   VARCHAR2 (2000);
begin
  data1:=data;
    if instr(data1,chr(39))>0 then 
       data1 :=  replace(data1,chr(39),'');
    end if; 
    if instr(data1,'"')>0 then 
     data1 :=  replace(data1,'"','');
    end if;
    if instr(data1,'`')>0 then 
     data1 :=  replace(data1,'`','');
    end if; 
    if instr(data1,'!')>0 then 
     data1 :=  replace(data1,'!','');
    end if;  
    if instr(data1,'(')>0 then 
     data1 :=  replace(data1,'(','');
    end if; 
     if instr(data1,')')>0 then 
     data1 :=  replace(data1,')','');
    end if; 
     if instr(data1,'*')>0 then 
     data1 :=  replace(data1,'*','');
    end if;
     if instr(data1,'^')>0 then 
     data1 :=  replace(data1,'^','');
    end if;   
      if instr(data1,'~')>0 then 
     data1 :=  replace(data1,'~','');
    end if;   
     if instr(data1,'……')>0 then 
     data1 :=  replace(data1,'……','');
    end if;   
     if instr(data1,'%')>0 then 
     data1 :=  replace(data1,'%','');
    end if; 
     if instr(data1,'——')>0 then 
     data1 :=  replace(data1,'——','');
    end if;  
     if instr(data1,'-')>0 then 
     data1 :=  replace(data1,'-','');
    end if;  
     if instr(data1,'+')>0 then 
     data1 :=  replace(data1,'+','');
    end if;   
     if instr(data1,'=')>0 then 
     data1 :=  replace(data1,'=','');
    end if;   
    if instr(data1,'[')>0 then 
     data1 :=  replace(data1,'[','');
    end if;    
     if instr(data1,'')>0 then 
     data1 :=  replace(data1,'','');
    end if;   
     if instr(data1,']')>0 then 
     data1 :=  replace(data1,']','');
    end if;   
    if instr(data1,'')>0 then 
     data1 :=  replace(data1,'','');
    end if;  
    if instr(data1,'|')>0 then 
     data1 :=  replace(data1,'|','');
    end if; 
     if instr(data1,'/')>0 then 
     data1 :=  replace(data1,'/','');
    end if; 
     if instr(data1,';')>0 then 
     data1 :=  replace(data1,';','');
    end if; 
     if instr(data1,':')>0 then 
     data1 :=  replace(data1,':','');
    end if; 
     if instr(data1,'”')>0 then 
     data1 :=  replace(data1,'”','');
    end if; 
     if instr(data1,'“')>0 then 
     data1 :=  replace(data1,'“','');
    end if; 
     if instr(data1,'"')>0 then 
     data1 :=  replace(data1,'"','');
    end if; 
     if instr(data1,';')>0 then 
     data1 :=  replace(data1,';','');
    end if; 
     if instr(data1,',')>0 then 
     data1 :=  replace(data1,',','');
    end if; 
     if instr(data1,',')>0 then 
     data1 :=  replace(data1,',','');
    end if; 
     if instr(data1,'<')>0 then 
     data1 :=  replace(data1,'<','');
    end if; 
     if instr(data1,'《')>0 then 
     data1 :=  replace(data1,'《','');
    end if; 
     if instr(data1,'>')>0 then 
     data1 :=  replace(data1,'>','');
    end if; 
     if instr(data1,'》')>0 then 
     data1 :=  replace(data1,'》','');
    end if; 
     if instr(data1,'。')>0 then 
     data1 :=  replace(data1,'。','');
    end if; 
     if instr(data1,'.')>0 then 
     data1 :=  replace(data1,'.','');
    end if; 
     if instr(data1,'?')>0 then 
     data1 :=  replace(data1,'?','');
    end if; 
     if instr(data1,'、')>0 then 
     data1 :=  replace(data1,'、','');
    end if; 
     if instr(data1,'@')>0 then 
     data1 :=  replace(data1,'@','');
    end if; 
     if instr(data1,'#')>0 then 
     data1 :=  replace(data1,'#','');
    end if; 
     if instr(data1,'¥')>0 then 
     data1 :=  replace(data1,'¥','');
    end if; 
     if instr(data1,'$')>0 then 
     data1 :=  replace(data1,'$','');
    end if; 
     if instr(data1,'!')>0 then 
     data1 :=  replace(data1,'!','');
    end if; 
     if instr(data1,'*')>0 then 
     data1 :=  replace(data1,'*','');
    end if;  
       if instr(data1,' ')>0 then 
     data1 :=  replace(data1,' ','');
    end if;  
          if instr(data1,'&')>0 then 
     data1 :=  replace(data1,'&','');
    end if;  
    return data1;
end FUNC_STRING_CLEAN;

以上是关于oracle 中怎么样去除关键字特殊意义?的主要内容,如果未能解决你的问题,请参考以下文章

oracle查询重复数据方法

Oracle 根据特定属性(列)去除重复数据

Oracle中查询某字段不为空的SQL语句怎么写

Oracle插入特殊字符 “&” 和 空格

2020-12-05 hive sql 截取最后一个特殊字符后面的内容

Oracle Minus关键字