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 -> Define Const for Date Format

Define Const for Date Format

From: Björn Wächter <Bjoern.Waechter_at_p3-solutions.de>
Date: Wed, 13 Jul 2005 09:13:48 +0200
Message-ID: <3jjtamFqae9vU1@news.dfncis.de>


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



Dipl.-Ing. Björn Wächter
P3 Solutions GmbH
Dennewartstr. 25-27
D-52068 Aachen
Germany
http://www.p3-solutions.com

tel +49(0)241/9437-417
fax +49(0)241/9437-431 Received on Wed Jul 13 2005 - 02:13:48 CDT

Original text of this message

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