DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: constraint question

  1. #1
    Join Date
    Feb 2001
    Location
    Master Control
    Posts
    86
    I am having some trouble. I want to cascade on delete and update, but I keep getting an error. Anyone know what I am doing wrong?


    CREATE TABLE t3 (
    a,
    b,
    CONSTRAINT fk_a FOREIGN KEY (a)
    REFERENCES t1 (a) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT fk_b FOREIGN KEY (b)
    REFERENCES t2 (b) ON DELETE CASCADE ON UPDATE CASCADE
    );

  2. #2
    Join Date
    Jan 2001
    Posts
    50
    there are some anamolies in your Create syntax
    1) u must specify the column datatypes
    2)i am not very sure wheather on update cascade is valid or not , but datatypes of all columns specufied is mandatory
    Aniruddha Gupta

  3. #3
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Talking always



    Note:
    Always create your tables with NO constraints, and then ADD constraints after table creation. This will help you debug constraint errors much more easily.

    - Magnus

  4. #4
    Join Date
    Feb 2001
    Location
    Master Control
    Posts
    86
    i thought that the references clause makes it inherit the data properties?

  5. #5
    Join Date
    Jul 2000
    Posts
    296
    ag_201074 is right.

Posting Permissions

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


Click Here to Expand Forum to Full Width