Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> SQL function return value
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)
(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
![]() |
![]() |