Board index » delphi » Can Oracle view perform "insert ,delete"?

Can Oracle view perform "insert ,delete"?

Hi all
   Can Orace View edit?
Thanks!
 

Re:Can Oracle view perform "insert ,delete"?


Hello Chongyang !

Yes, you can edit Oracle's views. But for that view should conform
following conditions:

1) You can edit only views, that preserves primary keys. That means,
that if some table[s] in view has PK and result set of view will have the
same columns as PK of this result set. Then you can edit (UPDATE)
fields of corresponding table (with PK).  Also you can do INSERT and
submit field values of this table and you can DELETE. Check Oracle
docu, it contains great explanation of "what, when, how".

2) Another option is to define INSTEAD OF [INSERT | DELETE |
UPDATE] trigger for view. This trigger will implement required for
you operations (insert, delete, update).

Regards,
Dmitry

--
===========================================
Dmitry L. Arefiev, director of gs-soft.ru ltd.
Solutions for successful companies

Author of NCOCI8 - Freeware Delphi to Oracle8i direct access

ICQ: 50741007
EMail: daref...@gs-soft.ru
Company: http://www.gs-soft.ru
NCOCI8: http://www.da-soft.com

Quote
"Chongyang Lee" <Chongyang...@hotmail.com> wrote in message

news:3c147e37_1@dnews...
Quote
> Hi all
>    Can Orace View edit?
> Thanks!

Re:Can Oracle view perform "insert ,delete"?


To find out what columns you can update, etc. you can execute the
following:
SELECT UPDATABLE, INSERTABLE, DELETABLE
FROM USER_UPDATABLE_COLUMNS
WHERE TABLE_NAME = 'YOUR_VIEW'

John Pierce

Other Threads