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个.当完全 ...
随机推荐
- C#函数式程序设计之惰性列表工具——迭代器
有效地处理数据时当今程序设计语言和框架的一个任务..NET拥有一个精心构建的集合类系统,它利用迭代器的功能实现对数据的顺序访问. 惰性枚举是一个迭代方法,其核心思想是只在需要的时候才去读取数据.这个思 ...
- Python 抓取html所有特定元素的方法
直接上代码哦,够直接了吧~ from lxml import etree #import mechanize import lxml.html #import cookielib #br = mech ...
- java中关于Collection和Map相关的类&接口之间的关系
上图(引用自)
- 【译文】不是所有的 bug 都值得修复的
原文作者:KRISTINE PINEDO 译者:白乐航 欢迎访问网易云社区,了解更多网易技术产品运营经验. 作为软件开发者,您只需要为客户编写和交付出色的产品和功能. 但您也知道软件开发并不总是那么容 ...
- Mac 上安装python3
1.安装包管理器 去包管理器官网按照提示安装包管理器 Homebrew 2.安装python3 安装完Homebrew ,输入指令安装python3 brew install python3 3.安装 ...
- IO模型《六》IO模型比较分析
IO模型比较分析 到目前为止,已经将四个IO Model都介绍完了.现在回过头来回答最初的那几个问题:blocking和non-blocking的区别在哪,synchronous IO和asynchr ...
- RDLC报表的相关技巧四(报表内依照分组重置页码)
报表中不同的组重置页数,如采购订单每一个PO显示的页数都是针对这个PO的,而不是总的页数. 步骤: 1.在各组实例中启用分页符2.用高级模式将组的属性中的ResetPageNumber设置为True3 ...
- linux 查看进程所在目录
一下内容转自:https://blog.csdn.net/spring21st/article/details/50561550 通过 ps 及 top 命令查看进程信息时,只能查到 相对路径,查不到 ...
- redis 限制接口访问频率
代码: <?php /** * */ class myRedis { private static $redis = null; /** * @return null|Redis */ publ ...
- js中apply详解
学习http://www.cnblogs.com/delin/archive/2010/06/17/1759695.html 1.对象的继承,一般的做法是复制:Object.extend protot ...