Home » SQL & PL/SQL » SQL & PL/SQL » Trigger on View (Oracle 9i, WIn Xp)
Trigger on View [message #382097] Tue, 20 January 2009 23:35 Go to next message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

Hi,
Is it possible to update a table using a trigger on VIEW? If not what is the other ways i can follow to update a table based on the data present in the VIEW. Please provide me a hints (If possible a sample code) to work.
Re: Trigger on View [message #382098 is a reply to message #382097] Tue, 20 January 2009 23:37 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you & please be consistent & correct in your postings.

Post DDL for tables.
Post DML for test data.

Post expected/desired results.
Re: Trigger on View [message #382099 is a reply to message #382097] Tue, 20 January 2009 23:44 Go to previous messageGo to next message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
mahatab wrote on Wed, 21 January 2009 06:35
Hi,
Is it possible to update a table using a trigger on VIEW?

In general, yes. It may have some limitations though. By the way, what is the statement on which the trigger should fire?
mahatab wrote on Wed, 21 January 2009 06:35
If not what is the other ways i can follow to update a table based on the data present in the VIEW. Please provide me a hints (If possible a sample code) to work.

Use UPDATE on that table or the view (again fulfiling some restrictions) covering it.
Re: Trigger on View [message #382106 is a reply to message #382097] Wed, 21 January 2009 00:16 Go to previous messageGo to next message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

I would like to work on INSERT trigger. I have got the values in the view now according to some logical condition i would like to update the specific table.
Re: Trigger on View [message #382107 is a reply to message #382097] Wed, 21 January 2009 00:17 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you & please be consistent & correct in your postings.

Post DDL for tables.
Post DML for test data.

Post expected/desired results.

Re: Trigger on View [message #382115 is a reply to message #382097] Wed, 21 January 2009 00:35 Go to previous message
Michel Cadot
Messages: 64138
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
PL/SQL User's Guide and Reference
Application Developer's Guide - Fundamentals
Search for "instead of" trigger.

Regards
Michel
Previous Topic: Need Help In Query (merged 3)
Next Topic: Retreiveing data from two tables (Merged)
Goto Forum:
  


Current Time: Thu Dec 08 06:34:53 CST 2016

Total time taken to generate the page: 0.14333 seconds