Reputation: 9
CREATE TABLE MyTable
(FName Varchar2(20) CONSTRAINT MyTable_FName_def DEFAULT 'MyName',
LName varchar2(20) );
I got the following error when I run the above query,
constraint specification not allowed here
Upvotes: 0
Views: 999
Reputation: 35716
If you examine The Oracle manual, you'll see that a DEFAULT
value does not need a CONSTRAINT
keyword
You should use:
CREATE TABLE MyTable
(
FName Varchar2(20) DEFAULT 'MyName',
LName Varchar2(20)
);
Upvotes: 1