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

Re: Define Const for Date Format

From: Sameer Deshpande <sameer_deshpande_at_hotmail.com>
Date: 13 Jul 2005 05:28:49 -0700
Message-ID: <1121257729.059700.93190@g44g2000cwa.googlegroups.com>


CREATE OR REPLACE function my_date RETURN CHAR AS BEGIN
    RETURN TO_CHAR(SYSDATE,'YYYY-MM-DD HH24:MI:SS'); END;
/

SQL> select my_date from dual;

MY_DATE



2005-07-13 14:24:43

SQL> set serveroutput on

SQL> declare
  2 my_date_format char(21);
  3 begin

  4     my_date_format := my_date;
  5     dbms_output.put_line('date is '||my_date_format);
  6 end;
  7 /

SQL> /
date is 2005-07-13 14:27:44

PL/SQL procedure successfully completed.

HTH Sameer Received on Wed Jul 13 2005 - 07:28:49 CDT

Original text of this message

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