Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ALTER TABLE syntax - missing DIRECTORY keyword

Tags:

sql

oracle

I am trying to alter a table in Oracle database by adding two new columns to it with SQL query as below:

ALTER TABLE Members 
      ADD annual_dues NUMBER(5,2) not null DEFAULT '52.50', 
      ADD payment_date DATE;

On executing it, I am getting an error as below:

SQL Error: ORA-30649: missing DIRECTORY keyword

I have played around it but it didn't help. What is wrong in the SQL query?

like image 568
Sarahfromnowhere Avatar asked Oct 13 '12 13:10

Sarahfromnowhere


1 Answers

I think you need to put NOT NULL after the DEFAULT 52.50:

ALTER TABLE Members 
   ADD ( annual_dues NUMBER(5,2) DEFAULT 52.50 NOT NULL
       , payment_date DATE );
like image 91
ypercubeᵀᴹ Avatar answered Oct 07 '22 06:10

ypercubeᵀᴹ