Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: More than one table for a Triggers

Re: More than one table for a Triggers

From: Vitalis Jerome <vitalisman_at_gmail.com>
Date: Wed, 1 Jun 2005 13:02:15 +0200
Message-ID: <68b1285505060104025e6a6114@mail.gmail.com>


On 6/1/05, Kean Jacinta <jacintakean_at_yahoo.com> wrote:
> Hi :)

>=20

> I know that one trigger can be assign to only one
> table.
> I have a situation here, Below are all the tables
>=20

> mapped_table
> ----------
> mappedid --pk
> comid
> empid
> passportno
>=20

> company_table
> --------------
> comid
> comname
> employee_table
> ---------------
> empid
> empname
> passportno
>=20

> The mapped_table takes the value from two other table
> which is company and employee tables.
>=20

> A trigger name :autoinsert_mapped_tr
> This trigger will automatically takes value
> comid,empid,passportno from both company and employee
> table into mapped_table on insert and mappedid is a
> seq number.
>=20

> Since trigger is tied to one table, how can the above
> scenario be done? I didn't want to create 2 triggers ,
> one for company on insert and another triggers for
> employee on insert.
>=20
>=20

> Thank You
> Jkean

Hi,

Firstly, is this a schema you are current designing? If so, and if one employee only works for one company, you should add a column comid in employee_table and get rid of mapped_table.

Otherwise, you haven't explained precisely what comid your app should use when inserting a row in mapped_table (after an insertion in employee_table has occured).

Jerome

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 01 2005 - 07:11:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US