Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Posts
    13

    Unanswered: Please..I need help quick!!

    I want to add some referential triggered actions to my foreign key constraint as shown:

    alter table SALESPERSON add
    (
    FOREIGN KEY(Store#) references STORE(Store#)
    on delete SET NULL
    on update CASCADE
    );

    But doing this gives me the "ORA-00907: missing right parenthesis" error message (which makes no sense!)

    However, the script below (which is exactly the same as above except I took out one of the triggered actions) works!

    alter table SALESPERSON add
    (
    FOREIGN KEY(Store#) references STORE(Store#)
    on delete SET NULL
    );

    I don't understand why it's like this. According to the examples in my DB textbook, adding both triggered actions in one statement is perfectly valid. Please help. Thanks.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Please..I need help quick!!

    Oracle does not support ON UPDATE CASCADE for foreign keys. You would have to implement this via triggers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •