dbTalk Databases Forums  

Triggers

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Triggers in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
artmerar@yahoo.com
 
Posts: n/a

Default Triggers - 08-05-2008 , 11:08 AM






Hi,

We have a table like this:

CUSTOMER_ID
PRODUCT_ID
FORMAT
STATUS
DATE_ADDED
DATE_MODIFIED

We also have a history table like this:

CUSTOMER_ID
PRODUCT_ID
FORMAT
STATUS
SOURCE
DATE_ADDED

We want to put a trigger on the first table such that when a record is
inserted or updated it will make the entry to the history table.
However, the problem is the 'SOURCE' column on the history table. It
is not present or needed in the first table.

Entries into the first table are done through a PL/SQL program. So,
what we want is that when the entry is made into the first table, it
fires the trigger to make the second entry. But, how can this be done
if the columns do not match?

We do not want to code it in the PL/SQL program because then someone
can make an entry to the first table and we cannot record the history
on it, yet the SOURCE column only gets populated in the PL/SQL
program....

Is there a way to do this?

Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Triggers - 08-05-2008 , 06:28 PM






artmerar (AT) yahoo (DOT) com wrote:
Quote:
Hi,

We have a table like this:
Please do not post your query more than once and in only one forum.

Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #3  
Old   
DA Morgan
 
Posts: n/a

Default Re: Triggers - 08-05-2008 , 06:28 PM



artmerar (AT) yahoo (DOT) com wrote:
Quote:
Hi,

We have a table like this:
Please do not post your query more than once and in only one forum.

Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #4  
Old   
DA Morgan
 
Posts: n/a

Default Re: Triggers - 08-05-2008 , 06:28 PM



artmerar (AT) yahoo (DOT) com wrote:
Quote:
Hi,

We have a table like this:
Please do not post your query more than once and in only one forum.

Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #5  
Old   
DA Morgan
 
Posts: n/a

Default Re: Triggers - 08-05-2008 , 06:28 PM



artmerar (AT) yahoo (DOT) com wrote:
Quote:
Hi,

We have a table like this:
Please do not post your query more than once and in only one forum.

Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.