Friday, June 1, 2012

Oracle data format

When inserting data into Oracle Database it is needed to format data. Here, it is shown, how is TIMESTAMP is used in Oracle.

id_ref_no_seq.nextval call the sequence created before. It will increase ref_no value by one and insert back into database.

insert into TABLE_NAME(ref_no,start_time) values(id_ref_no_seq.nextval,TO_TIMESTAMP('2012-06-01 11:41:20.061', 'YYYY-MM-DD HH.MI.SSXFF'))