易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle 的两个替换函数 REPLACE TRANSLATE


replace就是一般意义上的字符串替换,translate只是一个字符替换对应的一个字符,下面有手册说明,还有例子 O(∩_∩)O哈哈~
REPLACE
Syntax
Purpose
REPLACE returns char with every occurrence of search_string replaced with replacement_string. If replacement_string is omitted or null, then all occurrences of search_string are removed. If search_string is null, then char is returned.
Both search_string and replacement_string, as well as char, can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is in the same character set as char. The function returns VARCHAR2 if the first argument is not a LOB and returns CLOB if the first argument is a LOB.
REPLACE provides functionality related to that provided by the TRANSLATE function. TRANSLATE provides single-character, one-to-one substitution. REPLACE lets you substitute one string for another as well as to remove character strings.
Examples
The following example replaces occurrences of J with BL:
SELECT REPLACE('JACK and JUE','J','BL') "Changes"
from DUAL;
Changes
--------------
BLACK and BLUE
TRANSLATE
Syntax
PurposeTRANSLATE returns expr with all occurrences of each character in from_string replaced by its corresponding character in to_string.
Characters in expr that are not in from_string are not replaced. If expr is a character string, then you must enclose it in single
quotation marks. The argument from_string can contain more characters than to_string. In this case, the extra characters at the
end of from_string have no corresponding characters in to_string. If these extra characters appear in char, then they are removed
from the return value.
You cannot use an empty string for to_string to remove all characters in from_string from the return value. Oracle Database
interprets the empty string as null, and if this function has a null argument, then it returns null.
TRANSLATE provides functionality related to that provided by the REPLACE function


相关文档:

Oracle常用命令

1. 修改redo log file大小
SQL> select group#,status from v$log;
SQL> alter database add logfile group 4 'F:\oracle\product\10.2.0\oradata\orcl\REDO04.LOG' size 512m;
SQL> alter system switch logfile;
SQL> select group#,status from v$log;
2. 修改large_pool_size大小
SQL> alter  ......

Oracle 中如何删除重复数据

我们可能会出现这种情况,某个表原来设计不周全,导致表里面的数据数据重复,那么,如何对重复的数据进行删除呢?
重复的数据可能有这样两种情况,第一种时表中只有某些字段一样,第二种是两行记录完全一样。
一、对于部分字段重复数据的删除
先来谈谈如何查询重复的数据吧。
下面语句可以查询出那些数据是重复的:
se ......

oracle RAC同步频率设置

max_commit_propagation_delay默认值为700,即7秒(单位0.01s,http://www.orafaq.com/parms/parm1217.htm)。
这个参数应该配置的是RAC(Real Application Cluster)之间同步数据的频率。修改这个参数的好处就不用说了(
本人深受其苦啊
),但是如果走另一个极端,可能会给数据库造成更大的压力
参数指定一个instance ......

oracle数据库中查看所有表SQL

select   table_name   from   user_tables;     //当前用户的表  
   
  select   table_name   from   all_tables;     //所有用户的表  
   
  select   table_name   from   dba_tables;   &n ......

oracle居然能调用java程序

以前只知道java能调用oracle存储过程和函数,但今天我发现原来oracle也可以调用java
测试环境oracle 10g
call dbms_java.set_output(5000);
--首先在oracle中编译java文件 以下是个简单的
create or replace and compile java source named helloworld as
public     class   hellowor ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号