thank you for this exemple, but I'd also like to know if it could work for foreign keys.
In fact, I have a text file which describes all links between tables, and all updates between tables occurs by the side of the client software. But now, there are too many software that use the database, so...