Home > Ask the Oracle Database / Applications Experts > Oracle database internals Questions & Answers > Removing carriage returns at the end of clob fields
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Removing carriage returns at the end of clob fields

Mike Ault EXPERT RESPONSE FROM: Mike Ault

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 02 February 2006
I am trying to remove carriage returns at the end of clob fields by using the following in SQL*Plus:
update scbdesc a
set    a.scbdesc_text_narrative =
      (select substr(dbms_lob.substr(scbdesc_text_narrative),1,
              length(scbdesc_text_narrative) -1)
       from   scbdesc b
       where  substr(dbms_lob.substr(b.scbdesc_text_narrative),
              length(b.scbdesc_text_narrative),1) = chr(10)
         and  a.scbdesc_subj_code = b.scbdesc_subj_code
         and  a.scbdesc_crse_numb = b.scbdesc_crse_numb
         and  a.scbdesc_term_code_eff = b.scbdesc_term_code_eff
         and  a.scbdesc_term_code_end = b.scbdesc_term_code_end) where  substr(dbms_lob.substr(a.scbdesc_text_narrative),
       length(a.scbdesc_text_narrative),1) = chr(10)
This just nulls out the field in the table. What do I need to change to make this work? Thanks for your assistance!

>
Maybe just do a substitute (replace)?
SQL> create table test(cola clob);
SQL> insert into test values
('xxxyyy'||chr(10)||'zzzdddeee'||chr(10)||'ccccc')
SQL> /
SQL> commit;
SQL> select cola from test;

COLA
----------------------------------------------------------------------------
xxxyyy
zzzdddeee
ccccc

SQL> select replace(cola,chr(10),chr(32)) fixed from test;

FIXED
----------------------------------------------------------------------------
xxxyyy zzzdddeee ccccc


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



RELATED CONTENT
Oracle database internals
How to find a dropped table?
Finding length of numeric datatype field
Problem with incoming parameter in dynamic SQL statement
Reading WSID from back-end
Making a select statement faster
Select * from loc
Difference between 9i and 10g OCP exams
Concatenate values separated with commas
How to free up more space for Oracle?
Error after installation of 9i on Red Hat Linux

Oracle database design and architecture
How to use V$SEGMENT_STATISTICS to find the most accessed Oracle table
Can I install an Oracle client on Windows 7?
How to use the Oracle Database Upgrade Assistant (DBUA)
Can I specify Oracle column order in my database table?
Can I have a single Oracle 11g RAC instance across multiple databases?
How to use the Oracle export utility to duplicate database structure
How to choose the primary key columns in an Oracle table
Understanding the data archiving definition
Review: Oracle's 11g R2 database has some good and bad
Scaling an Oracle database: What is the best strategy for you?

Oracle and SQL
Can I specify Oracle column order in my database table?
Review: Oracle's 11g R2 database has some good and bad
SELECT statement syntax and examples
Oracle PL/SQL tutorial
PL/SQL datatypes in Oracle
PL/SQL functions and triggers in Oracle
Stored procedures in PL/SQL
Do I need a license for SQL Developer Data Modeler in Oracle?
Using the SQL GROUP BY clause for counting combinations
How to use an SQL CASE expression
Oracle and SQL Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
E. F. Codd  (SearchOracle.com)
extent  (SearchOracle.com)
flexfield  (SearchOracle.com)
foreign key  (SearchOracle.com)
multidimensional database  (SearchOracle.com)
object-oriented database management system  (SearchOracle.com)
quad tree  (SearchOracle.com)
relational online analytical processing  (SearchOracle.com)
row  (SearchOracle.com)
splay tree  (SearchOracle.com)

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