Home > Ask the Oracle Database / Applications Experts > Questions & Answers > Finding rows with non-printable characters in them
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Finding rows with non-printable characters in them

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site
>
QUESTION POSED ON: 11 September 2002
I need to find rows containing non-printable characters in a table. Is there any utility/method to do this in Oracle? The table in which I am searching has quite large number of rows (> 50,000).

>

There is no utility that Oracle makes which does this for you. You'll likely have to create your own utility. And it would probably be easiest if this was done in PL/SQL. A block such as the following can find any characters in a column which are non-alphabetic characters. It won't take too much work to convert this into a PL/SQL script to perform your needs.

DECLARE
   strLength   NUMBER;
   colContents VARCHAR2(255); 
   found       BOOLEAN:=FALSE;
BEGIN
   SELECT colX INTO colContents FROM tableY WHERE a=b;
   strLength:=LENGTH(colContents);
   LOOP
      -- If not 'a' to 'z', then set flag
      IF ASCII(SUBSTR(colContents,strLength,1)) <
ASCII('a')
      OR ASCII(SUBSTR(colContents,strLength,1)) >
ASCII('z')
      THEN
         found:=TRUE;
      END IF;
      strLength:=strLength-1;
      EXIT WHEN strLength=0;
   END LOOP;
   IF found THEN 
      DBMS_OUTPUT.PUT_LINE('Contains non-lower case');
   ELSE
      DBMS_OUTPUT.PUT_LINE('Contains only lower
case');
   END IF;
END;

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts