Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default MySQL relationship

    After a migration from Access to MySQL V5,
    I have lost the Access relationship.
    I tried to recreate them into MySQL, through declaration of foreign keys
    and delete cascade.
    When inserting my first data , I had this CF error :

    Cannot add or update a child row: a foreign key constraint fails
    (`stw/bout_famille`, CONSTRAINT `FK_bout_famille_1` FOREIGN KEY (`id_fam`)
    REFERENCES `bout_fam_car` (`car_id_fam`) ON DELETE CASCADE)

    The error occurred in
    C:\Inetpub\wwwroot\clients\STW\site_on_line\admin_ boutique\create_famille_save.c
    fm: line 87

    85 : insert into bout_famille
    86 :
    (apellation_fam,code_fam,description_fam,active_fa m,order_fam,famille_fam,speci
    fique,date_crea,gestion_stock,elec_file,activity)
    87 : values
    ('#form.fam_name#','#form.fam_code#','#form.fam_de s#',#act#,#next_order#,#parent
    #,#spec#,#createodbcdate(now())#,#stock#,#felec#,# activity#)
    88 : </cfquery>
    89 :

    Can someone help me, to make me understand how to create relationship inside
    MySQL ?
    Foreigh keys may be not the right way to create relationship ?
    (so easy under Access and MSSqlServer)

    Thanks for help,
    Pierre.



    plarts Guest

  2. Similar Questions and Discussions

    1. Relationship in MS Access
      In MS Access, there is an interface to draw the relationsip between tables. Do I really have to draw the relationship to obtain databse data?...
    2. many to one relationship
      How do I set up the tables and relationship such that I can reflect the item desc. of all items in my shopping cart? I am having item1, item2,...,...
    3. Breaking a relationship
      Any help will be appreciated- 1. Originally set up a combo box in a form referencing a look-up table. 2. Redesigned the look-up table and saved...
    4. Can it have dependences without a relationship among the tables?
      Can it have dependences without a relationship among the tables?
    5. threeway relationship?
      Ok, so I have been up since early this morning actually focusing on Filemaker, and the database I have been thinking about building since I got my...
  3. #2

    Default Re: MySQL relationship

    It sounds like you designed your database ok (not sure about the delete cascade
    part though), but you are inserting your data in the wrong order. You have to
    populate your parent table before you can populate your child table.

    Dan Bracuk Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139