Home » SQL & PL/SQL » SQL & PL/SQL » How to insert a record in another schema table through Trigger
How to insert a record in another schema table through Trigger [message #22825] Thu, 31 October 2002 06:00 Go to next message
SSV
Messages: 11
Registered: October 2002
Junior Member
hi , How to insert a Record in another users Schema table through a After insert trigger ? Both the schema's are DBA Privileged...

In case if its possible using Database links , please provide me the Syntax of it..

Thanks and Regards
ssv
Re: How to insert a record in another schema table through Trigger [message #22827 is a reply to message #22825] Thu, 31 October 2002 08:19 Go to previous messageGo to next message
B
Messages: 327
Registered: August 1999
Senior Member
just use OWNER.TABLE ...

Should have explicit right on the table ( not using a role )

connect c/passwd
create table test ( id number(1) );
create table b.test ( id number(1) );
grant select,insert on b.test to b;

SQL> l
1 create or replace trigger MY_TRIGGER instead of
2 INSERT
3 on MY_TEST
4 BEGIN
5 insert into b.test values ( :new.id );
6* END;

MY_TEST is a view on test

SQL> insert into my_test values (1);

1 ligne créée.

SQL> select * from test;

aucune ligne sélectionnée

SQL> select * from b.test;

ID
----------
1

Hope help
Re: How to insert a record in another schema table through Trigger [message #22831 is a reply to message #22825] Thu, 31 October 2002 09:39 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Please do not cross-post questions.

http://www.orafaq.net/msgboard/plsql/messages/11161.htm
Previous Topic: DATABASE TIMER
Next Topic: PL/SQL study for a complete newbie
Goto Forum:
  


Current Time: Sun Apr 28 23:49:44 CDT 2024