Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: function returns newlines
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 DBAReceived on Thu Aug 05 2004 - 16:15:06 CDT