Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-01442: column to be modified to NOT NULL is already NOT NULL when exporting

Eslam_ElbyalyAug 24 2020 — edited Aug 26 2020

Hi, I am using Sql Developer  Version 4.1.3.20 Build MAIN-20.78.

When I Export BP_TEST table through right click the table in the connections tab > tables> BP_TEST, I got the following,

CREATE TABLE "BP_TEST" ("ID" NUMBER DEFAULT ON NULL "BUSINESS_PARTNER_PK"."NEXTVAL", "NAME" VARCHAR2(100), "TYPE" NUMBER) ;

--  Constraints for Table BP

--------------------------------------------------------

  ALTER TABLE "BP_TEST" MODIFY ("ID" NOT NULL ENABLE);

  ALTER TABLE "BP_TEST" ADD CONSTRAINT "BP_PK" PRIMARY KEY ("ID") USING INDEX  ENABLE;

  ALTER TABLE "BP_TEST" MODIFY ("TYPE" NOT NULL ENABLE);

  ALTER TABLE "BP_TEST" MODIFY ("NAME" NOT NULL ENABLE);

When I try to run the above script in another schema, I got "ORA-01442: column to be modified to NOT NULL is already NOT NULL" error because of the first ALTER statement. The problem happens too when I use Tools menu> "Database Export" to export the whole schema. It happens with every table. Edited: and this is the main problem, exporting the whole schema's tables then running the script will cause many errors to appear, and I will have to go through everyone to see if they're all the same error or if there're other errors.

Comments
Post Details
Added on Aug 24 2020
13 comments
3,816 views