Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL und ForeignKeys

Empfohlene Antworten

Veröffentlicht

Hallihallo!

Ich hab in einer meiner Tabellen folgenden Foreign Key:

 FOREIGN KEY (f_id) REFERENCES firma (f_id) ON DELETE CASCADE;

Wenn ich jetzt aber aus der Tabelle firma einen Eintrag löschen will obwohl in der child table zugehörige Einträge vorhanden sind kommt er mir mit dieser Fehlermeldung:

ERROR 1217: Cannot delete a parent row: a foreign key constraint fails

Eigentlich sollten ja die zugehörigen Einträge in der child table gelöscht werden! Kann mir jemand erklären warum er das nicht macht? :confused:

Gruß,

Hallo,

welche MySQL Version?

Gruß Jaraz

Version MAX 4.0

MySQL/InnoDB-4.0.1, December 23, 2001

InnoDB is the same as in 3.23.47.

In 4.0.0 the MySQL interpreter did not know the syntax LOCK IN SHARE MODE. This has been fixed.

In 4.0.0 multi-table delete did not work for transactional tables. This has been fixed.

Falls du also 4.0.0 hast, solltest du auf 4.0.1 wechseln. Falls nicht, hilft dir vielleicht ein blick in die Doku. z.B. hier

Gruß Jaraz

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.