Home » SQL & PL/SQL » SQL & PL/SQL » Inserting date and time
Inserting date and time [message #39987] Fri, 30 August 2002 23:24 Go to next message
Binu
Messages: 4
Registered: August 2002
Junior Member
Hi
How to insert current system date and time into a table

Binu
Re: Inserting date and time [message #39988 is a reply to message #39987] Sat, 31 August 2002 06:27 Go to previous message
Venky
Messages: 52
Registered: October 2001
Member
Hi,

Hold the date and time in a variable as date datatype.

DECLARE
d_date DATE ;
BEGIN
d_date := to_date(to_char(sysdate,
'DD-Mon-RRRR HH24:MI:SS'),'DD-Mon-RRRR HH24:MI:SS') ;

END;
/

insert into
(date_field) values (d_date);

Hope this will hold good.

Venky.
Previous Topic: urgent
Next Topic: How to Select with more than one AND in a Where SQL Clause?
Goto Forum:
  


Current Time: Thu Mar 28 20:07:54 CDT 2024