Solved

Trigger to insert to table which is in database link

Posted on 2008-06-23
4
1,410 Views
Last Modified: 2013-12-18
I create a database link for my database named T24 , whenever  DOC table in our ddatabase is inserted , my trigger shall insert into VPB_STMT_ENTRY  table in Databaselink . I write the trigger but complication is error .

Help me please!
CREATE OR REPLACE TRIGGER sms_t24

    AFTER INSERT

        ON doc

        FOR EACH ROW

    

DECLARE

        v_username varchar2(10);
 

BEGIN

       

insert into vpb_stmt_entry@t24 

(id,

 account,

 update_time

)
 

 values

(:new.auth_code,

 :new.target_number,

 :new.AMND_DATE

 );

 END;

Open in new window

0
Comment
Question by:dinhchung82
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Milleniumaire
Comment Utility
The code looks okay, so I'm guessing the problem is related to permission.  

What is the compilation error?
0
 
LVL 5

Author Comment

by:dinhchung82
Comment Utility
I use pl/sql tool to write and compile . The error is "Warning: Trigger created with compilation errors"
I am newbie in pl/sql , would you tell me the way to show the error ?
0
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 50 total points
Comment Utility
Do you mean you use sqlplus?

Try typing the following after attempting to create the trigger:

show errors;
0
 
LVL 5

Author Closing Comment

by:dinhchung82
Comment Utility
Thanks so much , I am so tired for working all day so have mistake with typing .
The error is below when i use your command.
 "LINE/COL ERROR
-------- ------------------------------------------------
8/3      PL/SQL: ORA-00904: "ACCOUNT": invalid identifier
6/1      PL/SQL: SQL Statement ignored
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now