user1625645
user1625645

Reputation: 31

What is the SQL statement (Oracle) to alter column to DATE with default SYSDATE ?

I got a table name: kundorder

And a column name: datum. I want to change data typ to (DATE, SYSDATE), but I cant get it to work.

Upvotes: 3

Views: 29350

Answers (1)

hol
hol

Reputation: 8423

I think it should look like this

ALTER TABLE kundorder MODIFY datum DATE DEFAULT SYSDATE

That way you say that datum got to be of type date but if this is already the case of course

ALTER TABLE kundorder MODIFY datum DEFAULT SYSDATE

works also, letting the type of the field datum the same just making sure default is SYSDATE.

Upvotes: 11

Related Questions