using two tables in views having problem in the froms [message #200767] |
Wed, 01 November 2006 04:36 |
shankar muthusamy
Messages: 21 Registered: November 2006 Location: singapore
|
Junior Member |
|
|
Hi All,
I create a view with two tables, which is referred in the block of the froms, if i try to query the data it will populate the values but if i try to update the data it will not allow. But i need to update the data in front end.
Query is like
select a.col1 ,b.col3
from table1
, (select b.col1 ,v.col1 ,max(b.col3)
from table2 t ,view1 v
where v.col1 = t.col1) t2
where a.col2 = b.col2
which is in forms 10g.
Please help me to proceed further.
Regards
Shankar
|
|
|
|
Re: using two tables in views having problem in the froms [message #200901 is a reply to message #200787] |
Wed, 01 November 2006 16:47 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
You can only update a column that is marked 'updatable' in 'user_updatable_columns'. Search this forum for previous threads on this topic. Also read the Oracle Reference manual concerning when a view has a column which is or is not updatable. Basically, you can't use update through a view which does not contain the primary keys of both tables. Also, there must be a one-to-one relationship between the two tables - you use 'max' and a 'select' so I expect that there is not a one-to-one relationship. This means you will have to write your own code to do the updates or use a block based on a package that does the work.
David
|
|
|