I have col1
in myTable
which is varchar
, and I have to insert here timestamp eg:- 09-MAY-11 10.23.12.0000 AM
.
Now please tell me:
INSERT:
insert into myTable (col1) VALUES (to_char(systimestamp, 'dd-mon-yyyy hh.mi.ss.ff4 AM') );
SELECT:
select to_timestamp(col1, 'dd-mon-yyyy hh.mi.ss.ff4 AM') from myTable ;
But it is much better to store the data directly as a timestamp. Then you can compare the values or modify them directly.
create table myTable1( col1 timestamp default systimestamp);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With