From: Jamadagni, Rajendra [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 12:01 PM
To: '[EMAIL PROTECTED]'; Deshpande, Kirti
Subject: RE: Replacing control chars
Kirti,
if the input is going to be HTML, then I have no clue how you'd do it, but if it is just a varchar2 then something like following might help ...
SELECT REPLACE( UPPER(:my_str)
,REPLACE( TRANSLATE( UPPER(:my_str)
,'123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
,'-----------------------------------'
)
,'-'
)
)
FROM DUAL
/
It gets more complicated for mixed case queries.
Raj
______________________________________________________
Rajendra Jamadagni
MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any
opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is
an art!
-----Original Message-----
From:
Deshpande, Kirti [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 12:09 PM
To: Multiple recipients of list ORACLE-L
Subject:
Replacing control chars
Hello Listers,
I was asked if
there is any procedure that could be called from a trigger to replace (with a
blank) or remove all non-printable characters from the text before inserting it
in the target table? The incoming data is from a Web interface and may contain
underline, bold, blink, NL characters. Target column should get characters 0-9,
A-Z and a-z. The data should not be rejected.
I suggested use of 'replace', but was asked if I had
anything already written to do this. And I have not.
Done anyone have anything to share?
Thanks.
- Kirti