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 -> Much trouble working with Dates

Much trouble working with Dates

From: chiranjp <chiranjp_at_yahoo.com>
Date: 22 Mar 2002 11:27:35 -0800
Message-ID: <7b142cd4.0203221127.4a6d5740@posting.google.com>


I am tryong to get a handle on Date values in Oracle 8i.

I am using JDBC to set the session.getCretationTime() object via a Stored Procedure.

Here's the procedure:

create or replace procedure add_session_sp (v_sessionid varchar2,

v_userid varchar2,
v_logontime varchar2,
v_lastupdated varchar2,
v_ipaddress varchar2)

AS

BEGIN INSERT INTO sessions(
sessionid,
userid,
logontime,
lastupdated,
ipaddress)
VALUES(
v_sessionid,
v_userid,
to_date(v_logontime,'MM-DD-YYY hh:mi:ssAM'), to_date(v_lastupdated,'MM-DD-YYY hh:mi:ssAM'), ipaddress);

END; If I view the inserted record in the DBA Studio 'Table Data Editor', the date format is:

March 22,2002 1:29:55 PM

Obviosuly this is not the format I specified in the procedure.

Using SQL Plus>select logontime from sessions:

The result is 22-Mar-02

This also confuses me. What happened to the formatting in both cases? I'm sure I've done something wrong because it would seem very dumb to have to explicitly provide the format everytime. Received on Fri Mar 22 2002 - 13:27:35 CST

Original text of this message

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