Johnny Manolli
Johnny Manolli

Reputation: 13

Create a date column in oracle with default time value

I'm trying to create the following table:

CREATE TABLE helpToolStatsTest (
  customer nvarchar2(25),
  data nvarchar2(7),
  myDate Date NOT NULL DEFAULT CURRENT_DATE()
)

but I'm getting this error:

ORA-00907: missing right parenthesis

Upvotes: 1

Views: 97

Answers (1)

Aleksej
Aleksej

Reputation: 22949

According to the documentation:

CREATE TABLE helpToolStatsTest (
      customer nvarchar2(25),
      data nvarchar2(7),
      myDate Date DEFAULT CURRENT_DATE NOT NULL 
    )

Upvotes: 3

Related Questions