Check for ASCII values in fields

I am writing an app from another app and there is a function to cleanse certain fields because when the code was transferred to their DB it was sent as UNICODE or something like that. SO they are running this code to "cleanse" the fields

                strArray = stringEncodingTest.GetBytes(city)
                ansiiCleaned = stringEncodingTest.GetString(strArray)
                city = ansiiCleaned

I want to follow suit in SQL Developer

Any thoughts out there!!!
Who is Participating?
slightwv (䄆 Netminder) Commented:
I'm not sure what you are trying to do.

If you want to convert Unicode into the native characters take a look at UNISTR:

If you want to see if unicode characters exist in the column, you might be able to use  ASCIISTR and compare it with the column itself:

Some unicode characters are actually considered ascii so this is where the confusion comes in.

What is the characterset of the database?
What is the data type of the column in question?

Can you post some examples of what you are wanting to do?
jknj72Author Commented:
Is there a function that I can pass a string and get back maybe a true or false if there is something other then ASCII values?
jknj72Author Commented:
yeah sure I will get you some examples...Thanks
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
is it more of a case that your scrubbing the data and want only ASCII characters <127 (0-9, A - z)?

jknj72Author Commented:
Sorry for not responding for so long, I actually forgot I posted it. I wasn't at the point in my project but I am knee deep in it now....

Slight - I will read that article tonight and let you know what I come up with. Also will have to answer your questions tomorrow when Im at work

Jim - You are correct, The program I am rewriting scrubs the data because I guess when they did a migration of the data and that some of the data is in Unicode format, or something like that. I don't know the exact specifics.

Anyway, in the current program they run .NET functions to check a few columns and scrub the columns to just bring back ASCII values. I was hoping SQL Developer would have something similar.

Thanks guys!
slightwv (䄆 Netminder) Commented:
Seems like you are doing a LOT of .Net to Oracle porting.

You do know that Oracle now allows .Net stored procedures:

Might save you some time.
jknj72Author Commented:
Its all from the same program written in .NET accessing Oracle data so we decided to create a package with the logic from the .NET program in the package.  I wanted to do it in SSIS because the end result is tables being populated and then exported to text files for a vendor program to pick it up. I could have used the source as Oracle, manipulate the data, then have a text file destination.  But Im not the boss
jknj72Author Commented:
That's what I needed...Thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.