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

Home -> Community -> Usenet -> c.d.o.tools -> SQL function return value

SQL function return value

From: <derf23456_at_my-deja.com>
Date: Fri, 26 Jan 2001 15:40:39 GMT
Message-ID: <94s5pl$rib$1@nnrp1.deja.com>

I use "To_Char ( ??? , 'DD-Mon-YYYY HH24:MI:SS' )" a lot and, being lazy, created a function:

Create or Replace function Long_Date ( In_Date Date ) Return Varchar2
Is
Begin
Return ( To_Char ( In_Date , 'DD-Mon-YYYY HH24:MI:SS' ) ) ; End Long_Date ;
/

I'd expected a 20 character string as the return value but it seems that I'm getting a string with a length equal to my SQL*Plus setting for LineSize.

"Select Long_Date ( SysDate ) , Dummy From Dual ;" returns:

LONG_DATE(SYSDATE)



D
-
25-Jan-2001 08:09:15
X

(Using "SubStr ( To_Char ( In_Date , ...) , 1 , 20 )" in the function doesn't change the return value.)

How can I get only the "proper" length from my select?

Sent via Deja.com
http://www.deja.com/ Received on Fri Jan 26 2001 - 09:40:39 CST

Original text of this message

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