Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to handle varchar(4000) field containing carriage returns in reporting?

Re: How to handle varchar(4000) field containing carriage returns in reporting?

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 18 Oct 2006 08:23:57 -0700
Message-ID: <1161185032.895878@bubbleator.drizzle.com>


Carlos wrote:

> DA Morgan wrote:

>> Carlos wrote:
>>> Sameer wrote:
>>>> Hello,
>>>> I am having a Oracle database, the data in tables of which is being
>>>> stored using a web application. One of the fields of a table is having
>>>> varchar(4000) datatype.
>>>> The data in this field is text which may contain carriage returns also.
>>>> I have to create a report for this table. How to display this data
>>>> properly in a report?
>>>> I tried few things:
>>>> Accessed the table using SQL Developer and pasted the query output in
>>>> Excel.
>>>> As the text contains carriage returns, it is being spread into one or
>>>> more rows.
>>>> How to handle this?
>>>> What is the proper way to create report for such data?
>>>> Please help.
>>>> -Sameer
>>> Maybe REPLACE(your_column, CHR(10), ' ') will do the trick...
>>>
>>> HTH
>>>
>>> Cheers.
>>>
>>> Carlos.
>> I think:
>> REPLACE(your_column, CHR(10), NULL)
>> might work a bit better.
>>
>> But best to make sure it is really CHR(10) and not some other
>> character.
>> --
>> Daniel A. Morgan
>> University of Washington
>> damorgan_at_x.washington.edu
>> (replace x with u to respond)
>> Puget Sound Oracle Users Group
>> www.psoug.org
> 
> Daniel. I know it's not very important, but if you replace the CHR(10)
> (or the CHR(13)||CHR(10) in windows) with NULL's , you can find that
> something like:
> 
> "These are two
> words"
> 
> will appear as:
> 
> "These are twowords"
> 
> ;-)
> 
> Cheers.
> 
> Carlos.

Sometimes. Depends on the source. Other times you end up with: "These are two words"

But you are correct ... it is trivial as the OP should be able to observe what happens.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed Oct 18 2006 - 10:23:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US