REFERENTIAL INTEGRITY

I would like to know how RI is taken care of in SC. Say,… I have a Parent->Child relationship, which is like a 2 tables. When deleting the parent Record I want all the relative Child Records deleted. Do I have to program this into SQL or is there any mechanism build into SC ?

Arthur

Re: REFERENTIAL INTEGRITY

Hello,

in a form look at Dependencies in the left menu.
There you can define your dependencies (child tables) and delete automatically child records…

Best regards
Uwe Pfeiffer

Re: REFERENTIAL INTEGRITY

ohh, great, thanks (I missed that)
Arthur

Re: REFERENTIAL INTEGRITY

One other question:

Since I have an ability to resolve RI in SC, but I also can configure SQL to handle RI, which is preferable method ?
I have a feeling like setting up Foreign Keys in SQL is something SC doesn’t like (or I should say handle very well)

Arthur

Re: REFERENTIAL INTEGRITY

Hello,
it depends on what you want.

Using InnoDB with mysql you can define these dependencies too.

I prefer to do it in SC because I can create a useful message for the customer and to explain him why
he is not allowed to delete a record because there are dependent other records …

Best regards
Uwe Pfeiffer

Re: REFERENTIAL INTEGRITY

That is true, but For many databases (in my case now its MySQL) I can use modeling tools (like Workbench), and it nicely updates all existing data and tables, so this leaves nice piece of documentation. In many cases it is useful when working in a group, or simply to refresh your mind after few months. I noticed when I use InnoDB, and create Foreign Keys with CASCADE on Update/Delete or use UNIQUE attribute I have some problems changing records.

One other question: is there any danger of mixing InnoDB and MyISAM within one (same) database?

Arthur