MJ PK
MJ PK

Reputation: 11

Invalid data type PL SQL (Oracle)

Why am I getting following errors with this query?

-- NOT NULL
  ALTER TABLE employee
  MODIFY FirstName NOT NULL;

Error starting at line : 23 in command - ALTER TABLE employee MODIFY FirstName (NOT NULL) Error report - SQL Error: ORA-00902: invalid datatype 00902. 00000 - "invalid datatype" *Cause:
*Action: Table EMPLOYEE altered.

Upvotes: 0

Views: 143

Answers (1)

Littlefoot
Littlefoot

Reputation: 143163

Wrong syntax. Remove brackets.

SQL> create table employee (first_name varchar2(10));

Table created.

SQL> alter table employee modify first_name not null;

Table altered.

SQL>

Upvotes: 1

Related Questions