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

Home -> Community -> Usenet -> c.d.o.misc -> Re: function returns newlines

Re: function returns newlines

From: M Rothwell <ThisIsABadAddress_at_toobad.com>
Date: Thu, 05 Aug 2004 16:24:02 -0700
Message-ID: <4112c1f7$1@usenet01.boi.hp.com>


Sybrand Bakker wrote:

> On Thu, 05 Aug 2004 14:04:58 -0700, M Rothwell
> <ThisIsABadAddress_at_toobad.com> wrote:
> 
> 

>>I have a function that returns a single character value CHAR.
>>
>>I have a query:
>>
>>select colA, myfunction( colB )
>> from TableA;
>>
>>The query results are:
>>
>>09381520039
>>X
>>
>>09381520039
>>X
>>
>>I dont understand where the new lines are coming from. If I re-write
>>the query as follows:
>>
>>select colA, chr( ascii( myfunction( colB ) ) )
>> from TableA;
>>
>>I get the following output:
>>
>>09381520039 X
>>09381520039 X
>>
>>Is there an easier (read, cleaner) way to get the output on a single line?
>>
>>Thanks
> 
> 
> 
> try aliasing your function with eg myfunc
> prior to your select
> column myfunc format a
> 
> As you have an expression with an undetermined length, it's width in
> sql*plus is automatically 80. The default linesize is also 80.
> Probably set linesize 132 will also resolve the issue
> 
> 
> --
> Sybrand Bakker, Senior Oracle DBA

I did end up trying that, and it worked. But is what's interesting is that it worked fine in the 8i db, but had the linefeed in the 9i db.

Thanks.

Michael Received on Thu Aug 05 2004 - 18:24:02 CDT

Original text of this message

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