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

Home -> Community -> Usenet -> c.d.o.server -> Re: insert data from other instance

Re: insert data from other instance

From: Terry Dykstra <dontreply_tdykstra_at_cfol.ab.ca>
Date: Wed, 17 Jan 2001 20:03:54 GMT
Message-ID: <KUm96.27947$OD6.2560063@news1.telusplanet.net>

Something like this perhaps. It's very basic:

CREATE OR REPLACE TRIGGER tia_tableA
 AFTER INSERT
 ON tableA
 FOR EACH ROW  DECLARE

     errno             integer;
     errmsg            varchar2(200);

  insert into tableB_at_dblink_to_databaseB    (col1, col2, ...)
  values (
   :new.col1, :new.col2
   );

  exception

      when .... then
         errno := SQLCODE;
         errmsg := SUBSTR(SQLERRM, 1, 200);
    raise_application_error(errno, errmsg);

END tia_tableA;
/

--
Terry Dykstra
Canadian Forest Oil Ltd.
<suberbie_at_my-deja.com> wrote in message news:944ntg$9sb$1_at_nnrp1.deja.com...

> Joe:
>
> I'm looking an example for a trigger that executes a DB link into
> another database and insert in some tables.
> Because the solution is when I insert in Table_A instance A this date
> go to TABLE_B Instance B in transparent mode. but replication for this
> problem only is too hard. you nknow
>
> thanks
>
>
> In article <3a658391$0$35016$2c3edae7_at_news.voyager.net>,
> "Joe Bonner" <jbonner_at_voyager.net> wrote:
> > You're in need of replication. It is available only in the enterprise
> > edition but it does exactly what you require.
> > It comes with maintenance baggage but fulfills your requirements.
> > Joe B>
> >
> > <suberbie_at_my-deja.com> wrote in message
news:9425pk$4vi$1_at_nnrp1.deja.com...
> > > I have 2 instaces "A" and "B"
> > >
> > > In the instance "A" I have a table TABLE_A and in the instace "B"
the
> > > table TABLE_B.
> > >
> > > I need to put a trigger that when I insert data in TABLE_A the event
> > > executes "something" (store procedure) and insert data in the
> > > instance "B" in the table TABLE_B
> > >
> > > Another information: TABLE_A is diferent from TABLE_B , this produce
> > > that I need to manipulate info in the store procedure triggred and
put
> > > some values in hardcode or from another tables.
> > >
> > > I have Oracle 8i and I need an example code if it is posible
> > >
> > > Thanks
> > > Suber
> > >
> > >
> > >
> > >
> > >
> > >
> > > Sent via Deja.com
> > > http://www.deja.com/
> >
> >
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Wed Jan 17 2001 - 14:03:54 CST

Original text of this message

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