oracle dump的使用心得
使用DS开发的时候,有的时候会遇到一个问题:数据库层面定义的空格与DS自已定义的空格概念不一致,导致生成的数据会有一定的问题.
举例来说:
在数据库里面定义CHAR(20),如果插入的字符不足20的时候,会自动补空格(ascii为0x20);在DS里面的话,源数据如果不满足20的话,那么DS也会自动补全,此时补的值为ascii 0x00。那么,这条记录在数据库里面的话,表面上是看不出异常的,但是加条件查询的时候,是查不出来结果集的。此时,就要用到dump来判断是否有此类情况出现。
oracle的dump函数就不介绍了,需要用到的时候,请google即可。
The argument
return_fmtspecifies the format of the return value and can have any of the following values:
8 returns result in octal notation.
10 returns result in decimal notation.
16 returns result in hexadecimal notation.
17 returns each byte printed as a character if and only if it can be interpreted as a printable character in the character set of the compiler—typically ASCII or EBCDIC. Some ASCII control characters may be printed in the form ^X as well. Otherwise the character is printed in hexidecimal notation. All NLS parameters are ignored. Do not depend on any particular output format for
DUMPwithreturn_fmt17.By default, the return value contains no character set information. To retrieve the character set name of
expr, add 1000 to any of the preceding format values. For example, areturn_fmtof 1008 returns the result in octal and provides the character set name ofexpr.The arguments
start_positionandlengthcombine to determine which portion of the internal representation to return. The default is to return the entire internal representation in decimal notation.If
expris null, then this function returnsNULL.
select dump(test_col) from test_tb;
Typ=96 Len=15: 54,52,54,53,51,49,57,32,32,32,32,32,32,0,0
typ表示当前的expr值的类型。如:2表示NUMBER,96表示CHAR。然后长度就是15位,最后二位就是ascii 0.
那么,这个时候查询这条记录是没办法查询出来的。
select * from test_tb where trim(replace(test_col,chr(0),''))='6465319' --按此查询即可得出结果。
PS:一般遇到这种情况,最好的办法是在DS的定义里面把char改成varchar,让DB来做填充空格的操作。
oracle dump的使用心得的更多相关文章
- oracle dump数据库
最近正在看老白的<DBA的思想天空>,了解数据块结构,想通过dump data block验证oracle对于行尾的NULL,是不占用存储空间的. 我们先来看一下怎样dump数据块: 1. ...
- oracle dump event
一.Memory Dumps 1).Global Area ALTER SESSION SET EVENTS 'immediate trace name global_area level n'; 1 ...
- Oracle dump 分析secondary key
验证secondary key 含有主键列数据 SQL> select object_name,object_id,OBJECT_TYPE from user_objects; OBJECT_N ...
- 通过Oracle DUMP 文件获取表的创建语句
1. 有了dump文件之后 想获取表的创建语句. 之前一直不知道 dump文件能够直接解析文件. 今天学习了下 需要的材料. dump文件, dump文件对应的schema和用户. 以及一个版本合适的 ...
- Oracle dump函数的用法
一.函数标准格式: DUMP(expr[,return_fmt[,start_position][,length]]) 基本参数时4个,最少可以填的参数是0个.当完全没有参数时,直接返回null.另外 ...
- [转]oracle 实施方法论学习心得
本周由部门新入职的同事为我们分享oracle实施方法论,本次重点围绕项目启动会来做介绍,并着重介绍了oracle与我们不一样的地方.收获颇丰,简单总结几个值得学习借鉴的要点: 1. 细节 ...
- SQL Server 2008创建oracle链接服务器(心得)
操作系统是32位的情况下,曾经没费太多时间创建好了到oracle的链接服务器.主要要点就是: 1.安装oracle精简客户端.当时我用的是版本比较低的“oracle9i310-客户端简化版”,安装好了 ...
- 还原ORACLE DUMP 的值
还原DUMP出来的数字SQL> select dump(2000,16) from dual; DUMP(2000,16)------------------Typ=2 Len=2: c2,15 ...
- 【Oracle】dump函数用法
Oracle dump函数的用法 一.函数标准格式: DUMP(expr[,return_fmt[,start_position][,length]]) 基本参数时4个,最少可以填的参数是0个.当完全 ...
随机推荐
- Class Loading Deadlocks
By tomas.nilsson on Feb 28, 2010 Mattis keeps going strong, in this installment you get to learn eve ...
- sheel远程执行
https://www.cnblogs.com/softidea/p/6855045.html shell远程执行: 经常需要远程到其他节点上执行一些shell命令,如果分别ssh到每台主机上再去执行 ...
- 网络安全之iptables防火墙
1>各种传输方式到最后都会转化为能够通过网络发送的数据格式: 1>文本格式: 2>二进制格式:2>TCP三次握手连接,四次断开,连接时客户端是主动打开,服务器是被动 打开,处于 ...
- alpha七天冲刺计划
alpha七天冲刺计划(更新ing) 第一天:https://www.cnblogs.com/renluqian/p/9895895.html 第二天: 第三天: 第四天: 第五天: 第六天: 第七天 ...
- ResorceGovernor--基础和Demo
资源调控器分为三部分:1:资源池,将资源CPU/MEMORY划分到不同的载体上2:负载组,承载负载并将负载映射到不同的资源池3: 分类函数,将不同回话映射到不同的负载组08提供两种预定义的系统资源池1 ...
- 【python】@property装饰器
Python内置的@property装饰器可以把类的方法伪装成属性调用的方式.也就是本来是Foo.func()的调用方法,变成Foo.func的方式.在很多场合下,这是一种非常有用的机制. class ...
- Win7 家庭普通版开启超级管理员
将以下内容copy保存为admin.reg文件 Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ ...
- win10 git 报错 Host key verification failed
从code.aliyun.com切回github 原先的known_hosts里记录的是code.aliyun.com的ip,必须新加一个github的. known_hosts报错Host key ...
- 「HNOI 2015」亚瑟王
\(Description\) 有\(n\)张卡牌,每一张卡牌有\(p_i\)的概率发动,并造成\(d_i\)点伤害.一共有\(r\)轮,每一轮按照编号从小到大依次考虑,如果这张牌已经发动过则跳过该牌 ...
- leetcode 48. 旋转图像 java
class Solution { public void rotate(int[][] matrix) { int n = matrix.length; for (int k = 0; k < ...