ORA-00942 Errors (merged 3) [message #382038] |
Tue, 20 January 2009 14:03 |
|
Hi,
I am having serious trouble, though i know the meaning of such errors, yet not finding the solution i needed the most. I have checked it again and again but no such errors i have discovered yet. So i guess i have got something wrong in my trigger code, So will you please take a look at my code and send me a hints to work with.
CREATE OR REPLACE TRIGGER "DO_DCMBL".FFF_ACHIEVE_Tr AFTER
INSERT
ON Master_Sales_Tbl
FOR EACH ROW
BEGIN
IF INSERTING THEN
declare
emp_id varchar2(20);
percentage number(10,2);
begin
select emp_id, percentage into emp_id, percentage from field_force_tbl
where :master_sales.party_code=field_force_tbl.distributor_id;
UPDATE Do_Dcmbl.FIELD_Achievement_Tbl
SET Achieved_Qty_Monthly =
nvl(Achieved_Qty_Monthly,0) + (:New.product_quantity*percentage/100),
Achieved_Amt_Monthly =
nvl(Achieved_Amt_Monthly,0) + (:New.Sales_amount*percentage/100)
WHERE FIELD_Achievement_Tbl.product_Code =:New.product_Code AND
FIELD_Achievement_Tbl.emp_id=field_force_tbl.emp_id AND
FIELD_Achievement_Tbl.DISTRIBUTOR_code=:New.DISTRIBUTOR_CODE AND
FIELD_Achievement_Tbl.MONTH_ID=:New.MONTH_ID AND
FIELD_Achievement_Tbl.TARGET_YEAR=:New.YEAR;
END IF;
END;
END;
/
[Updated on: Tue, 20 January 2009 14:22] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: ORA-00942 Errors (merged 3) [message #382048 is a reply to message #382038] |
Tue, 20 January 2009 14:47 |
|
Thanks for the reply next time i will be more watchful. Table or view does not exist-this is the error i am getting but i have checked it again and again but all the table name i used is in the db what to do next. Is there any other mistakes i have made?
|
|
|
|
Re: ORA-00942 Errors (merged 3) [message #382052 is a reply to message #382038] |
Tue, 20 January 2009 14:55 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
When a procedure owned by SCHEMA accesses an object owned by SCHEMAB, it can result in ORA-00942 error when no GRANT has been issued.
Privs acquired via ROLE do not apply within PL/SQL procedures.
|
|
|