Home » Developer & Programmer » Forms » date time prob
date time prob [message #308732] Tue, 25 March 2008 05:32 Go to next message
salwa
Messages: 76
Registered: December 2007
Member
hi
how to insert data into table date time from forms 10g
(database item)
Re: date time prob [message #308758 is a reply to message #308732] Tue, 25 March 2008 06:38 Go to previous messageGo to next message
kernel
Messages: 3
Registered: March 2008
Junior Member
hello...

did you try this?

insert into tbl(date) values(to_date(sysdate,'DD/MM/YYYY'))

or to_date(sysdate,'dd/mm/YYYY hh24:mi')

try it?
Re: date time prob [message #308773 is a reply to message #308758] Tue, 25 March 2008 07:03 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
@kernel: TO_DATE(SYSDATE) doesn't make any sense; SYSDATE already is a date.

@salwa: What do you, actually, want to do? Store both date AND time into a table column? If so, no problem! DATE datatype contains these information. Just make sure to use format mask which will allow you to see what you need. For example:
SQL> create table test (dt date);

Table created.

SQL> insert into test values (sysdate);

1 row created.

SQL> select dt, to_char(dt, 'dd.mm.yyyy hh24:mi:ss') dt_2 from test;

DT       DT_2
-------- -------------------
25.03.08 25.03.2008 12:59:13

SQL>
Note that TO_CHAR is used (not TO_DATE!).

If this isn't what you are looking for, could you describe it once again (but this time using more than single statement with no punctuation).
Re: date time prob [message #308778 is a reply to message #308773] Tue, 25 March 2008 07:26 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
On a second thought, perhaps you are talking about the TIMESTAMP (column) and DATETIME (item) datatypes? If so, perhaps you'll be interested in reading this discussion.
Previous Topic: how call report from menu
Next Topic: working with ip address
Goto Forum:
  


Current Time: Mon Mar 10 21:56:08 CDT 2025