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: Perl and Java and PL/SQL and SYSDATE

Re: Perl and Java and PL/SQL and SYSDATE

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 1 Dec 2004 17:28:44 -0800
Message-ID: <41ae6fcc@news.victoria.tc.ca>


Craig & Co. (crb_at_amsa.gov.au) wrote:

: to insert data (including SYSDATE) into a table.

: The code in the PL/SQL package is

: INSERT INTO MESSAGE_DETAILS (

: VALUES (
#1

  TO_DATE(

	    TO_CHAR( SYSDATE, 'DD-MON-YYYY HH24:MI:SS') ,
            'DD-MON-YYYY HH24:MI:SS'
         ),

#2

  TO_DATE(

	    TO_CHAR(SYSDATE, 'DD-MON-YYYY')
         )


Why convert the date to a char and back to a date?

surely #1 can be written simply as SYSDATE

surely #2 can be written simply as TRUNC( SYSDATE )

Whether this has anything to do with your problem,, I have no idea. Received on Wed Dec 01 2004 - 19:28:44 CST

Original text of this message

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