how to give input from dev 6i in a column having timestamp data type in 11g r2

21 views Asked by At

I want to give input from dev 6i to 11g r2 database having timestamp data type column.

I tried to insert value like this insert into table(timestamp_column) values(to_date(SYSDATE,'DD-MON-YYYY HH:MI AM'))

I also tried with to_char and to_timestamp but dev 6i does not recognise to_timestamp and does not accept to_char.

I get this error expression is of wrong type.

1

There are 1 answers

2
MT0 On

You do not need to use TO_DATE, TO_TIMESTAMP when the value is already a DATE or TIMESTAMP and you do not want to use TO_CHAR when the column is not a string.

If you are inserting into a TIMESTAMP column then simply use SYSTIMESTAMP:

INSERT INTO table_name (timestamp_column) VALUES (SYSTIMESTAMP)

You could also use SYSDATE (but it will not have fractional seconds that SYSTIMESTAMP has):

INSERT INTO table_name (timestamp_column) VALUES (SYSDATE)