DB2 views - Read Only

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kburton
    New Member
    • Oct 2006
    • 6

    DB2 views - Read Only

    What criteria is used by the system to determine if a view is read only? I created a view that involves two tables. It does display columns from each of the tables. All columns in both tables can be updated. I am not using any functions on the columns, no calcuations, no group or having clauses. The tables have no constraints of any kind at this time.

    create view as select a.name, b.id,bname,b.va lue1, b.values2 from tablea a, tableb b
    where b.id = a.id;

    This is being marked as 'Read Only' in the system. Is this due to multiple tables in the view creation? Now each table to have several columns that can't be null. Could that be why?
  • frozenmist
    Recognized Expert New Member
    • May 2007
    • 179

    #2
    Hi,
    You cant insert into the view any way because it contains select columns from two tables...
    Is this what you meant?

    Cheers

    Comment

    • Kburton
      New Member
      • Oct 2006
      • 6

      #3
      You can't insert, update or delete from a view that contains more than one table or the fact that it contains columns from more than one table?

      If I have a view that joins two tables but only displays columns from a single table, could I insert, delete or update via the view?

      Using my scenario from the original posting, can I create 'instead of triggers' on the view and perform insert, update, and deletes?

      Comment

      Working...