après recherche
oui les clefs étrangères sont supportées (comme écrit plus haut) mais j'ai pas l'impression que l'effacement sur des tables multiples soit possible..
1.7.4.5 Foreign Keys
Note that foreign keys in SQL are not used to join tables, but are used mostly for checking referential integrity (foreign key constraints). If you want to get results from multiple tables from a SELECT statement, you do this by joining tables:
SELECT * FROM table1,table2 WHERE table1.id = table2.id;
See section 6.4.1.1 JOIN Syntax. See section 3.5.6 Using Foreign Keys.
In MySQL Server 3.23.44 and up, InnoDB tables support checking of foreign key constraints. See section 7.5 InnoDB Tables. For other table types, MySQL Server does parse the FOREIGN KEY syntax in CREATE TABLE commands, but without further action being taken.
The FOREIGN KEY syntax without ON DELETE ... is mostly used for documentation purposes. Some ODBC applications may use this to produce automatic WHERE clauses, but this is usually easy to override. FOREIGN KEY is sometimes used as a constraint check, but this check is unnecessary in practice if rows are inserted into the tables in the right order.
In MySQL Server, you can work around the problem of ON DELETE ... not being implemented by adding the appropriate DELETE statement to an application when you delete records from a table that has a foreign key. In practice this is as quick (in some cases quicker) and much more portable than using foreign keys.
In MySQL Server 4.0 you can use multi-table delete to delete rows from many tables with one command. See section 6.4.6 DELETE Syntax.
In the near future we will extend the FOREIGN KEY implementation so that the information will be saved in the table specification file and may be retrieved by mysqldump and ODBC. At a later stage we will implement the foreign key constraints for applications that can't easily be coded to avoid them.
Do keep in mind that foreign keys are often misused, which can cause severe problems. Even when used properly, it is not a magic solution for the referential integrity problem, although it does make things easier in some cases.
Some advantages of foreign key enforcement:
* Assuming proper design of the relations, foreign key constraints will make it more difficult for a programmer to introduce an inconsistency into the database.
* Using cascading updates and deletes can simplify the client code.
* Properly designed foreign key rules aid in documenting relations between tables.
Disadvantages:
* Mistakes, which are easy to make in designing key relations, can cause severe problems?for example, circular rules, or the wrong combination of cascading deletes.
* A properly written application will make sure internally that it is not violating referential integrity constraints before proceding with a query. Thus, additional checks on the database level will only slow down performance for such an application.
* It is not uncommon for a DBA to make such a complex topology of relations that it becomes very difficult, and in some cases impossible, to back up or restore individual tables.
---------------
La musique c'est comme la bouffe, tu te souviens du restaurant dans lequel t'as bien mangé 20 ans plus tôt, mais pas du sandwich d'il y a 5 minutes :o - Plugin pour winamp ©Harkonnen : http://harko.free.fr/soft