易截截图软件、单文件、免安装、纯绿色、仅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经验

注: 这是个人看Oracle视频时写下的笔记, 多有错误, 望各位切勿吝惜赐教.
 
1. Dos
下登陆超级管理员

 

sqlplus sys/
密码
as sysdba
 
2.
更改管理员

alter user scott account unlock;
 
3.
数据的备份
.
 
A
导出
:
Cmd

:       ......

dspace windows oracle install

 今天了解了一下开源dspace软件,现将安装过程总结如下:
1、环境设置
   1.1 下载jdk1.6.x并安装,安装时选择默认安装路径即可
       一般为 C:\Program Files\Java\jdk1.6.0_10
       设置JAVA_HOME,设置CLASSPATH和PATH
2、组件准备 ......

oracle 列转行实例

select * from (select pro_id, sum(decode(month, '01', summ)) one,
                    sum(decode(month, '02', summ)) two,
             &nb ......

如何高效删除Oracle数据库中的重复数据

Oracle 数据集成解决方案
  Oracle数据集成解决方案用于在SOA、BI和数据仓库环境中构建、部署和管理以实时数据为中心的架构,包含了数据集成的所有要素——实时数据移动、转换、同步、数据质量、数据管理和数据服务——能确保各个复杂系统的信息及时、准确、一致。
  通过使用Oracle数据集成,企 ......

Oracle 目录服务

Create directory让我们可以在Oracle数据库中灵活的对文件进行读写操作,极大的提高了Oracle的易用性和可扩展性。
其语法为:
CREATE [OR REPLACE] DIRECTORY directory
AS 'pathname
';
本案例具体创建如下:
create or replace directory exp_dir as '/tmp';
目录创建以后,就可以把读写权限授予特定用 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号