Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Define Const for Date Format
Hi,
I'm using TO_CHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DD HH24:MI:SS')
very often. So if I want to change the format I a have to
change it very often. What is the best way to save the format
at only one place?
I tried:
CREATE OR REPLACE PACKAGE userconst AS
date_format CHAR(21) := 'YYYY-MM-DD HH24:MI:SS';
END userconst;
But when I try to use it I get an error:
SELECT TO_CHAR(SYSDATE,userconst.date_format) FROM DUAL;
ORA-06553: PLS-221: 'DATE_FORMAT' is not a procedure or is undefined
Björn
tel +49(0)241/9437-417
fax +49(0)241/9437-431
Received on Wed Jul 13 2005 - 02:13:48 CDT
![]() |
![]() |