By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

trigger error

P: 17
hello

I want to update in one trigger the tables in to another schema but it doesn't work but when i select data from sql prompt it works fine.

can any body help me.

thanks.


Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE TRIGGER Product_Detail_TR
  2.      BEFORE
  3.  INSERT ON Product_Detail FOR EACH ROW
  4.  DECLARE
  5.   PRE_ITEM_ID NUMBER :=0 ;
  6.  BEGIN
  7.  select :new.Item_Id into PRE_ITEM_ID from dual ;
  8.  Select Product_Detail_SEQ.NextVal into  :New.Item_Id from Dual;
  9.  update neo.GIFT_NOTES  set Item_Id=:New.Item_Id where Item_Id=PRE_ITEM_ID ;
  10.  update neo.PRODUCT_DIGITAL_DOWNLOAD set Item_Id=:New.Item_Id where Item_Id=PRE_ITEM_ID ;
  11.  End;
  12.  
  13.  
  14.  
  15. Warning: Trigger created with compilation errors.
  16.  
  17. SQL> show errors trigger product_detail_tr
  18. Errors for TRIGGER PRODUCT_DETAIL_TR:
  19.  
  20. LINE/COL ERROR
  21. -------- -----------------------------------------------------------------
  22. 6/1      PL/SQL: SQL Statement ignored
  23. 6/12     PL/SQL: ORA-00942: table or view does not exist
  24. 7/1      PL/SQL: SQL Statement ignored
  25. 7/12     PL/SQL: ORA-00942: table or view does not exist
  26.  
  27. SQL> select count(*) from neo.product_digital_download;
  28.  
  29.   COUNT(*)
  30. ----------
  31.      54565
Dec 27 '07 #1
Share this Question
Share on Google+
1 Reply


debasisdas
Expert 5K+
P: 8,127
Ensure that you have required priviliges on GIFT_NOTES and PRODUCT_DIGITAL_DOWNLOAD tables.
Dec 27 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.