Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Location
    Poland
    Posts
    3

    Question Unanswered: Referential constraints / cascade delete operation

    I have a problem with referential constraints.

    Situation is quite obvious:
    Master table Person - keyed by ID field
    detail table, for example, Phones, joined with 'Person' by
    Phones.IDPerson -> Person.ID (by lookup table - and it works perfectly).
    But - when I want to delete a person-record, I want all Phones record joined with this Person to be removed automatically (simple Cascade
    update rule).

    And here's a problem: By Database Desktop I can set UpdateRule to Cascade; but it looks as it works only for updates; i still can't delete Master record. Also, in SQLExplorer, in referencial constraints, i have "Modify operation" set to 'cascade', but 'Delete operation' is still set to 'Restrict' - and i can't change it.

    Is any solution of this problem - or maybe, is any better utility for creating, managing, etc. Paradox Databases than Database Desktop?

    Thanks for any help

    Kuba Poskrobko
    posk@o2.pl

  2. #2
    Join Date
    Oct 2003
    Posts
    107
    Cascade deletes are not supported by Paradox/BDE. You have to do them programatically.

    If the relational database is constructed properly, you would simply do delete queries based on the key values of the record set you are trying to delete.

  3. #3
    Join Date
    Jan 2004
    Location
    Poland
    Posts
    3
    Thanks very much for answer - I haven't found it in documentation (maybe i haven't looked for it enough deeply).

    I know that programically it works (i've already developed it); but i've a simple database with few tables - and every of them is connected with another; and is accessed from many points.

    Thanks one more time for answer.
    But i have another (connected with previous one) question: is any (can be commercial - but quite cheap and simply) DB engine that provides full referencial constraints? (i know that for example MSSQL does it) - maybe full Paradox also is able to perform it?

    Thanks for any help

    Kuba Poskrobko
    posk@o2.pl

  4. #4
    Join Date
    Oct 2003
    Posts
    107
    I'm only familiar with Paradox, so I'll leave that question to someone else. I'm sure Oracle will do it, but that's like killing an ant with a sledge hammer.

  5. #5
    Join Date
    Aug 2003
    Location
    Bologna - Italy
    Posts
    209
    Many referential db engines provide full cascade delete, but any db which supports triggers can be turned into providing such capability, since full cascade delete is only a set of delete queries triggered by a delete in the main table.

    By the way, the limit to FCD is in the BDE, so even the full Pdox has this limit.

    Since there are many situations in which you DON'T want the cascade delete, i've always preferred doing this by code, rather than by referential integrity.

    bye!
    The only failure is not trying to do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •