Results 1 to 4 of 4

Thread: updating views

  1. #1
    Join Date
    Jul 2003
    Posts
    16

    Unanswered: updating views

    I have a view that selects data from more than one table. If I run an update statement against a view field that uses one of the tables then it works. However, if I run an update statement against a view field that uses a different table then I get the message: "cannot modify a column which maps to a non key-preserved table".

    From searching on the internet I have seen that triggers can be used with views if multiple tables need to be updated. Can this be any kind of trigger or does it need to be an "instead of" trigger. Also, if I used an instead of trigger on the view does it need to handle the updates to all of the tables or just the table that the view is not updating by default? If a view can only update one table by default then is there a way to specify which table it should update or does the view have logic for deciding which table to update?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    use a Materialized View which updates on commit.
    then add a refresh log and you are all set.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Jul 2003
    Posts
    16
    I did "create materialized view" but I still get the same error.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    please post your creation script and the log script.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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