Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1795
  • Last Modified:

Trigger to insert to table which is in database link

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
dinhchung82
Asked:
dinhchung82
  • 2
  • 2
1 Solution
 
MilleniumaireCommented:
The code looks okay, so I'm guessing the problem is related to permission.  

What is the compilation error?
0
 
dinhchung82Author Commented:
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
 
MilleniumaireCommented:
Do you mean you use sqlplus?

Try typing the following after attempting to create the trigger:

show errors;
0
 
dinhchung82Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now