I have two tables related by an FK.
I need that when entered data in these tables, a trigger is triggered that you take the data of these two tables and insert in only another third table.
Can anyone give help?
Trigger to enter data from two tables in just one.
-
- Moderador
- Posts: 2016
- Joined: Wed, 12 Jan 2005 3:25 pm
- Location: Araraquara - SP
Abraço,
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Petter, some doubts Brother:
1) Will you do some logging scheme?
2) Simultaneously, or can they be two triggers, one on each table?
Whatever it sends there.
1) Will you do some logging scheme?
2) Simultaneously, or can they be two triggers, one on each table?
Whatever it sends there.
- fabricio.silva
- Rank: Programador Pleno
- Posts: 34
- Joined: Mon, 12 Mar 2007 7:07 am
- Location: Catanduva/SP
Fabricio M. Silva
Oracle Certified Associate
------------------------------
Catanduva - SP
Oracle Certified Associate
------------------------------
Catanduva - SP
Hello colleague,
Is it possible to create a view of these two tables?
If yes, you could create a trigger instead of in the view and make the inserts you need.
ABS.
Is it possible to create a view of these two tables?
If yes, you could create a trigger instead of in the view and make the inserts you need.
ABS.
-
- Rank: Analista Sênior
- Posts: 147
- Joined: Thu, 16 Mar 2006 11:26 am
- Location: São Paulo
O mundo gira muito!!
Speak Pyro,
Good morning,
Friend, it provides the solution to the glufke galera if possible, so the circular information ... Exchange the table name by tab_a and column, by col_a ... by the privacy issue of your company !!
Anything posts here in the forum!
abs hahu
Good morning,
Friend, it provides the solution to the glufke galera if possible, so the circular information ... Exchange the table name by tab_a and column, by col_a ... by the privacy issue of your company !!
Anything posts here in the forum!
abs hahu
Follow how the final trigger was:
create or replace trigger insert
after insert on tab_a
for each row
declare
bb number(6);
b number(5);
begin
select cod_b, cod_bb
into b,
bb
from tab_b
where bbb = :new.b1;
insert into tab_c(c1, c2, c3, c4, c5)
values(:new.b2, :new.b3, :new.b4, bb, b);
end insert;
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest