如何在Oracle查询中显示字段的隐藏字符?

编程入门 行业动态 更新时间:2024-10-26 20:23:55
本文介绍了如何在Oracle查询中显示字段的隐藏字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两行具有varchar列,这些列根据Java .equals()的不同而有所不同.我无法轻松地更改或调试针对该特定数据库运行的Java代码,但是我确实有权使用SQLDeveloper直接针对该数据库进行查询.这些字段对我来说看起来是一样的(它们是街道地址,两行之间用一些新行或运输工具行/新行组合隔开).

I have two rows that have a varchar column that are different according to a Java .equals(). I can't easily change or debug the Java code that's running against this particular database but I do have access to do queries directly against the database using SQLDeveloper. The fields look the same to me (they are street addresses with two lines separated by some new line or carriage feed/new line combo).

有没有一种方法可以查看所有隐藏字符作为查询的结果?我想避免必须在每行上使用ascii()函数和substr()来找出哪个隐藏字符不一样.

Is there a way to see all of the hidden characters as the result of a query?I'd like to avoid having to use the ascii() function with substr() on each of the rows to figure out which hidden character is different.

我还将接受一些查询,该查询向我显示哪个字符是两个字段之间的第一个区别.

I'd also accept some query that shows me which character is the first difference between the two fields.

推荐答案

尝试

select dump(column_name) from table

更多信息,请参见文档.

关于查找字符不同的位置,这可能会给您一个想法:

As for finding the position where the character differs, this might give you an idea:

create table tq84_compare ( id number, col varchar2(20) ); insert into tq84_compare values (1, 'hello world'); insert into tq84_compare values (2, 'hello' || chr(9) || 'world'); with c as ( select (select col from tq84_compare where id = 1) col1, (select col from tq84_compare where id = 2) col2 from dual ), l as ( select level l from dual start with 1=1 connect by level < (select length(c.col1) from c) ) select max(l.l) + 1position from c,l where substr(c.col1,1,l.l) = substr(c.col2,1,l.l);

更多推荐

如何在Oracle查询中显示字段的隐藏字符?

本文发布于:2023-06-05 01:12:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/508798.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   字符   如何在   Oracle

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!