473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

one trigger for two different tables

137 100+
hi all,
can we write a trigger in such a way that same trigger is fired when any query executes for two different tables.
i mean to say,
i have two tables tbla, tblb. right now i have written one trigger which inserts in tblc whenever there is any insertion, deletion or updation in tbla. now what i want is can i insert in tlbc itself when i have insertion, or deletion or updation in tblb also at the same time. some field of tbla and some field of tblb.

ie
tbla contains name, address
tblb contains tel,mailing_add.
now when a trigger is fired, then tlbc should contain tbla.name, tblb.mailng_add.
can it be done?

with regards,
Jun 23 '08 #1
2 5210
rski
700 Expert 512MB
i'm afraid my english s not good enough to understand what you need.
You want a trigger which is fired when you for example delete from both tables simultaneously?
or you want a trigger witch is fired when you for example delete from tab_a or tab_b and which is inserting data from both tables into tab_c?

sorry for my poor english
Jun 26 '08 #2
coolminded
137 100+
thanx rski,
let me clear my problem. i 'm using vb6 and postgres. my one form inserts data in both tbl_a and tbl_b simultaneously. whenever i have to update or insert or delete in that form, both the tables tbl_a and tbl_b get effected.

so whenever i delete or update or insert in that form i want a trigger to be fired so that i can insert the old data of both tables in the new table tbl_c.

now i think you are clear.

is it possible to do so?
with regards,
Jun 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Galina | last post by:
Hello I work with Oracle 9 database. I want to create a trigger using 2 tables: KEY_SKILLS_STUDENT and KEY_SKILLS. There are fields in KEY_SKILLS_STUDENT: KEY_SKILLS_ID, PORTFOLIO_RESULT and...
1
by: Rebecca Lovelace | last post by:
I have a trigger on a table. I am trying to dynamically log the changed fields on the table to another table, so I am iterating through the bits in COLUMNS_UPDATED() to find what's changed, and...
6
by: Scott CM | last post by:
I have a multi-part question regarding trigger performance. First of all, is there performance gain from issuing the following within a trigger: SELECT PrimaryKeyColumn FROM INSERTED opposed...
6
by: Mary | last post by:
We are developing a DB2 V7 z/OS application which uses a "trigger" table containing numerous triggers - each of which is activated by an UPDATE to a different column of this "trigger" table. When...
13
by: Tolik Gusin | last post by:
Hello All, DB2 UDB 8.1 FP3 for Linux The table has 4 triggers on the Insert operation. Three triggers small (200 bytes) and one trigger large (3 ËÂ). In the large trigger there is one long...
5
by: Dave Sisk | last post by:
Hey folks: I'm trying to do this: CREATE TRIGGER datawhse.emp_ti AFTER INSERT ON emp REFERENCING NEW AS n FOR EACH ROW MODE DB2ROW BEGIN DECLARE v_rrn DECIMAL(15,0);
2
by: Tim Vadnais | last post by:
Hi, My boss wants to add some logging functionality to some of our tables on update/delete/insert. I need to log who, when, table_name, field name, original value and new value for each record,...
9
by: Ots | last post by:
I'm using SQL 2000, which is integrated with a VB.NET 2003 app. I have an Audit trigger that logs changes to tables. I want to apply this trigger to many different tables. It's the same trigger,...
4
zachster17
by: zachster17 | last post by:
Hello all, I have 2 tables (tblAddProviderProfessional and tblAddProvider). There are other tables such as tblAddProviderFacility and so forth. tblAddProvider is a table that has similar data...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.