tags:

views:

30

answers:

1

Hi everyone !

I'm having a problem with an SQL statement. I want to activate a "ON UPDATE CASCADE" behavior for a foreign key in a table with this statement :

ALTER TABLE "DB"."RECORD" ADD CONSTRAINT "RECORD_PT_OUTIL_FK1" FOREIGN KEY ("CDE_PO")
REFERENCES "DB"."PT_OUTIL" ("CDE_PO") ON UPDATE CASCADE ENABLE;

But when i run the statement in Oracle Developer, i just get this error message : "ORA-00905 : missing keyword" I can't find what could be this missing keyword, i tried several changes but always the same error occurs. I reuse a code generated by Oracle Developer it self and just modify it with what i want. This is the generated code :

ALTER TABLE "DB"."RECORD" ADD CONSTRAINT "RECORD_PT_OUTIL_FK1" FOREIGN KEY ("CDE_PO")
REFERENCES "DB"."PT_OUTIL" ("CDE_PO") ON DELETE CASCADE DISABLE;

See, i just change the end of it. So what's the matter here ? Am i missing something ? (please don't bash if it's something obvious :) ) Thx !

A: 

Try by removing the DISABLE/ ENABLE at the end of your command

As per the ADD CONSTRAINT reference, there doesnt seem to be any "Enable / Disable" as part of the command.

I think it is something that your Oracle Developer is adding at the end (it being part of Oracle Syntax) and it might be causing the problem!!

InSane
I try without ENABLE but still the same error message.
B1ll0u
I give you the DDL generated to create the Table, maybe you'll see something weird ... :
B1ll0u
@B1ll0u - what db engine are you using in MySQL? Is the table in question using MyISAM or InnoDB?
InSane