If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Create Updatable View

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-04, 19:51
parkerbw parkerbw is offline
Registered User
 
Join Date: Feb 2004
Location: Nevada
Posts: 5
Create Updatable View

Can anyone show me a create view that allows the tables in the view to be updatable. Every view I create sets the syscat.views readonly column to Y. So I can use the update statement in my view. How do I Make that a N in the syscat.views table ????

Thank a head of time....
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 20:03
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: Create Updatable View

If you are joining mutiple tables or using a function (like date(col2)) you cannot update it ...

Post a few of your views and someone may be able to help

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 02-10-04, 00:26
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: Create Updatable View

Quote:
Originally posted by sathyaram_s
If you are joining mutiple tables or using a function (like date(col2)) you cannot update it ...

Post a few of your views and someone may be able to help

Cheers
Sathyaram
I quote the manual here:

"Updatable views:

A column of a view is updatable if all of the following are true:
– the view is deletable
– the column resolves to a column of a base table (not using a dereference operation) and READ ONLY option is not specified
– all the corresponding columns of the operands of a UNION ALL have exactly matching data types (including length or precision and scale) and matching default values if the fullselect of the view includes a UNION ALL

A view is updatable if ANY column of the view is updatable."

For more details please see DB2 SQL manual.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On