Oracle – How to Create Table with Default DATE Column Using { ts }

oracle

Oracle Database 11g Express Edition Release 11.2.0.2.0 – 64bit Production

create table my_table ( 
    transaction_date DATE DEFAULT { ts '1900-01-01 00:00:00' } NULL 
)

error —

ORA-00911: invalid character
00911. 00000 -  "invalid character"
*Cause:    identifiers may not start with any ASCII character other than
           letters and numbers.  $#_ are also allowed after the first
           character.  Identifiers enclosed by doublequotes may contain
           any character other than a doublequote.  Alternative quotes
           (q'#...#') cannot use spaces, tabs, or carriage returns as
           delimiters.  For all other contexts, consult the SQL Language
           Reference Manual.

As the above create statement is generated by a third-party software, what's the correct syntax without using date or to_date()?

Best Answer

Whatever syntax that is, that is not correct in Oracle.

Use this:

create table my_table ( 
    transaction_date DATE DEFAULT timestamp'1900-01-01 00:00:00' NULL 
);