Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 3 Monaten
Letzter Beitrag:
vor 2 Jahren, 3 Monaten
Beteiligte Autoren:
GuenterP, CCC2, DarrenF, Al, Curtis

[WD] Cascading Deletion - Manually or by Link Constraint?

Startbeitrag von Curtis am 29.03.2016 21:08

How many of you use link constraints to handle the deletion of children records in your deployed applications? Does it work well? Any hiccups?

If you use SQL instead is it because you don't trust the link constraints?


Hello Curtis

I have no links at all in my analysis (over 500 files) because I don't trust anyone else to do the deletes. I have a central deletion process that handles all deletions. People tell me I am a control freak but I think that is quite normal for a programmer :)


von Al - am 29.03.2016 22:08

I have many links in my analysis. The hiccups aren't so much around the cascading deletions but more around producing the actual SQL with WX - it tries to help you. It will include tables in your SQL that you don't expect! And it was quite difficult to get rid of the unwanted tables. I say "was" because I think the situation improved with WX20, i.e. no unexpected tables.

von DarrenF - am 29.03.2016 23:36

Depend, if you are using Database server like ms-sql , mysql , oracle, postgresql then it is save.

for flat-file database like HF classic , it is better you create delete procedure (delete from child to parent).

in DB server , in case of power OFF, when you ON back , the server will auto rollback or continue the process while for flat-file database , the data will be partial deleted . if you have delete procedure, you can just call it in the program.

von CCC2 - am 30.03.2016 04:33
Hi Curtis, I did extensive tests of cascading deletes and found it to work properly and as expected. Testing comprised simple keys only, means strings and numeric values. Not composed keys. Whether you're doing the deletions "manually" or automatically, one thing should be clear: if the index file of any of the related files is damaged then the operation will fail at some point! Same applies to propagated changes of key values, just to mention the other automatic operation in HFSQL files. It's absolutely insignificant whether you're employing manual, SQL or automatic methods!

To my sad experience, many of our customers do not repair damaged files whenever they experience an HFSQL error but rather try to get along without. In a number of cases that will work just fine (for them) and they continue their work without re-indexing / repairing their files. Even after re-indexing any number of problems can appear. What's left are flawed datafiles. I'm thinking about exporting the datafiles to CSV format, delete the datafiles and re-import the raw data.

von GuenterP - am 30.03.2016 07:34
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.