Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting using Relationships problem

Status
Not open for further replies.

chrigil

Programmer
Sep 23, 2003
178
GB
I am in the process of converting an Access DB over to MySQL which up until now has been a relatively simple task.
The problem that I am faced with now is that MySQL doesn't appear to actually support any sort of relationship system in the same way to Access. For example, imagine I have three tables:

UserDetailsTable
UserBiogTable
UserCommentsTable

complete with the relevant information in each one.
With Access, if I set up relationships I am able to delete the a record in the UserTable and all the related records in UserBiogTable and UserCommentsTable are automatically deleted. Hardly rocket science but very useful.

It appears however that this is impossible in MySQL unless I manually delete all associated records.
Is this right or am i missing something? I was under the impression that MySQL was a RDBMS but this appears not to be correct?????

Thanks in advance, Chris.
 
MySQL does not, as opposed to Access, support any mechanism for formally defining a relation between two tables. A relation is said to be "notional" -- it only exists within the context of a query.

Newer versions of MySQL support a multitable deletion syntax.

Also, MySQL supports foreign key constraints and cascading deletions



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top