All I wanted to do was to add a column to a pre existing table in the Database and give it a default value.
My SQL was:
ALTER TABLE Table1
ADD Column1 VARCHAR2(1) not null default 'N';
I kept getting this error:
ORA-30649: missing DIRECTORY keyword
Cause: DEFAULT DIRECTORY clause missing or incorrect.
Action: Provide the DEFAULT DIRECTORY.
Well, google did not help. What is a default directory anyway? So I played with my SQL a little bit more and came up with:
ALTER TABLE Table1
ADD Column1 VARCHAR2(1) default 'N' not null;
It was just a sequence problem in the SQL Statement. Im a no SQL Expert and when I look at such Oracle error numbers it does nothing but confuse me.
3 comments:
Thanks, this post really helped.
I was able to trigger the query on mssql, oracle n mysql db:
ALTER TABLE Table1 ADD NewColumn NUMERIC(5) DEFAULT 0 NOT NULL;
So that new column is added to existing table and default value is set 0 for all rows.
Thank you very much for your answer. It resolved my problem
Hi,it was nice post. resolved my problem.
Post a Comment