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: Sybrand Bakker <gooiditweg_at_sybrandb.verwijderdit.demon.nl>
Date: Thu, 05 Aug 2004 23:15:06 +0200
Message-ID: <tk85h05mmc4iovit8lbujf1bv148i9qnd8@4ax.com>


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
Received on Thu Aug 05 2004 - 16:15:06 CDT

Original text of this message

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