Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am loading a .csv file in an Oracle table but I have seen that I have strange characters in one of the fields such as: ?, ?

How can I validate that this does not happen in the other fields like varchar2?

question from:https://stackoverflow.com/questions/65935497/search-for-strange-characters-in-oracle-table

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
127 views
Welcome To Ask or Share your Answers For Others

1 Answer

For each of your varchar2 columns, you need to search for multi bytes characters like below. Lengthb function returns the size of a string in bytes. asktom

with t as (
select 'à?êsgdkf fdd' col1 from dual union all
select 'mno?ijk' col1 from dual union all
select 'abc fdd' col1 from dual
)
select col1
from t
where length(col1) < lengthb(col1)
;

COL1
----------
à?êsgdkf fdd
mno?ijk

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...