sql - oracle: why cant i insert into view -
i created simple view columns single table. when try insert values table, ora_01732 error dml not legal on view. have order clause in view definition i've gathered not allowed inherently updatable , i'm seeing have use instead of type clause in view definition. can show me how build view updatable way?
here create view statement:
create view cust_view select customer#,firstname,lastname,state book_customer order state, lastname;
are sure order by
cause observation?
i can insert on view order clause:
create table tq84_table ( number, b number ); create view tq84_updateable_view select a, b tq84_table order a; insert tq84_table values (4,1); insert tq84_table values (1,4); insert tq84_table values (3,9); insert tq84_table values (7,5); select * tq84_updateable_view; insert tq84_updateable_view values (1,9); select * tq84_updateable_view;
the above statements run no problem on oracle 11 r2.
you might want check user_updatable_columns
columns can insert to:
sql> select * user_updatable_columns table_name = 'tq84_updateable_view'; owner table_name column_name upd ins del ------------------------------ ------------------------------ ------------------------------ --- --- --- rene tq84_updateable_view yes yes yes rene tq84_updateable_view b yes yes yes
Comments
Post a Comment