Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

is this code correct

Posted on 2011-05-11
2
Medium Priority
?
239 Views
Last Modified: 2012-05-11
Is the below code right if so wht does it mean exactly when im running it in editor im getting error saying 'invalid sql statement'

TRIM (REPLACE (REPLACE (REPLACE (rec_pdr_email.message_to, CHR (10), ''), CHR (13), ''), CHR (9), ''))
0
Comment
Question by:thota198
  • 2
2 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 35743020
The 'syntax' is correct.  It replaces the ascii characters 10,13, and 9 (Line feed, Carriage return and tab) from the string.

You can see it with:

select TRIM (REPLACE (REPLACE (REPLACE ('He      llo', CHR (10), ''), CHR (13), ''), CHR (9), ''))
from dual;
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35743022
I might go with a regexp_replace:

select trim(regexp_replace('He      llo', '['|| chr(10)||chr(13)||chr(9) || ']','')) from dual;
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question