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.

Fremdschlüssel by mySQL

Empfohlene Antworten

Veröffentlicht

Hi, ich hab mir bei www.apachefriends.org php und mySQL gesaugt,

nun möchte ich ne DB erstellen, die 2 Tabellen hat, welche mit nem FK verknüpft sind.

Bekomme ich das dann in Access angezeigt?

denn wenn ich mir die Tabellen anzeigen lasse, werden keine FK angezeigt...

und löschanomalien kommen immer noch vor...

Artikel

a_id -> PK

a_hid -> FK

a_artnr

a_name

a_preis

Hersteller

h_id -> PK

h_name

h_kontakt

Mein Server hat die Verion 4.0.14-nt also sollte es doch funzen...?

1.

create table hersteller(

h_id int(3) not null auto_increment,

h_name varchar(10),

h_kontakt varchar(10),

primary key (h_id));

2.

create table artikel(

a_id int(3) not null auto_increment,

a_hid int(3) not null,

a_artnr int(5) not null,

a_name varchar(10),

a_preis decimal(10,2),

primary key (a_id)

foreign key (a_hid) references hersteller(h_id));

wenn ich jetzt die hersteller und die artikel fülle, und dann einen referenzierten hersteller lösche sollte das doch nicht funzen...

Hi,

also so weit wie ich das weiß unterstützt mySQL keine Referenzielle Integrität.

Also auch keine Foreign Keys (der Befehl ist aus kompatibilitäts Gründen implementiert, hat aber keine Funktion) und kaskadierende Delets.

Datt musst Du selber programmieren.

Original geschrieben von sylvester

Hi,

also so weit wie ich das weiß unterstützt mySQL keine Referenzielle Integrität.

Also auch keine Foreign Keys (der Befehl ist aus kompatibilitäts Gründen implementiert, hat aber keine Funktion) und kaskadierende Delets.

Datt musst Du selber programmieren.

Hast du dir mal den Link angeschaut. :confused:

Und es geht doch!

Gruß Jaraz

ich löse solche probleme mit joins - klappt auch wunderbar

[EDIT] Bist du sicher das ab MySQL 4 der standardtyp InnoDB ist?? meines erachtens ist der MyISAM...

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.