INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Find ASCII code of characters in columns

Find ASCII code of characters in columns

(OP)
Hi

I create a file that contains numerous columns with a Product Description. These can contain spurious characters such as tabs and a plus above a minus etc. This file is rejected in the next process until I remove these records.

In the SQL I can keep on adding characters to exclude using the Like function e.g. where Product_Description like '%%' though I was hoping to be cleverer about this.

Looking at ASCII codes realistically I need to exclude those less than 32 and above 122.

I can identify products by running the SQL below looking at each character in the field, i.e. twenty times as it's Char(20):-
Sel Product_Description

FROM product

WHERE ascii(substr(product_description,7,1)) < 32
or ascii(substr(product_description,7,1)) > 122

Is there a way of identifying descriptions with these characters without performing it at substring level? If I could find the Position of a character in Product_Description where Ascii code > 122 etc then it would save me writing the code twenty times for each occurrance of Product_Description.

Does anybody have any suggestions and the syntax to help me identify these fields containing these characters?

Any help would be most appreciated.

Ian

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close