1

I am attempting to run this script to create a table, however I get a column not allowed error. After doing some research it seems that it could be that it could be a syntax error concerning values, however I am not inserting any values.

CREATE TABLE SALESPERSON (
 sales_id     VARCHAR2(10) PRIMARY KEY,
 sales_fname  VARCHAR2(35) NOT NULL,
 sales_lname  VARCHAR2(35) NOT NULL,
 sales_email  VARCHAR2(35) NOT NULL,
 sales_region VARCHAR2(35) NOT NULL CHECK(sales_region IN ('NORTH','SOUTH','EAST','WEST')),
 sales_phone  CHAR(10)  NOT NULL,
 hire_date    DATE DEFAULT 01-JAN-2001 NOT NULL);

What am I overlooking?

0

2 Answers 2

0

I am getting a different error message, but probably due to the same mistake. You can't set the default to 01-JAN-2001. Perhaps just putting it in single quotes will fix it; better, to_date('01-JAN-2001', 'DD-MON-YYYY').

Sign up to request clarification or add additional context in comments.

1 Comment

This solved the problem.
0

Put quotes on your default date:

hire_date    DATE DEFAULT '01-JAN-2001' NOT NULL);

1 Comment

It's better not use a string as a date this way; a better way could be using to_date

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.