Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2005
    Posts
    362

    Unanswered: Foreign Key,on Delete

    I want to make a foreign key with 'on delete cascade' but there is an error.
    How can I resolve that?

  2. #2
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    Can you post the error? We don't have any psychic powers, so resolving an unspecified error is a bit of a challenge
    I'm not crazy, I'm an aeroplane!

  3. #3
    Join Date
    Jan 2005
    Posts
    362
    I write this code
    Code:
    alter table dimis.emp add constraint my 
    foreign key (depno) REFERENCES dimis.dept (deptno)
    on delete cascade on update cascade
    and the error is
    Code:
     Error: Incorrect syntax near the keyword 'on'.

  4. #4
    Join Date
    May 2008
    Posts
    10

    RE:Foreign Key,on Delete

    I don't think 'on delete cascade' is supported by Sybase ASE. Rather you will have to use triggers, to achieve the 'on delete cascade' effect.

  5. #5
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    That is crrect. The create/alter-table command does not contain any option for specifying cascading deletes/updates. You can use a trigger for that.
    I'm not crazy, I'm an aeroplane!

Posting Permissions

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