Trigger not fetching data
CREATE OR REPLACE TRIGGER apps.qp_list_lines_trg
AFTER INSERT OR UPDATE ON qp_list_lines
REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
IF INSERTING THEN
v_a := :new.list_line_id;
v_b := :new.list_price;
SELECT distinct b.segment1
FROM qp_pricing_attributes a,mtl_system_items b
WHERE a.product_attr_value = TO_CHAR (b.inventory_item_id)
INSERT INTO staging_tab VALUES(v_a,v_b,v_c);
Now the select query in the body of trigger fails due to no data found i.e there is no matching list_line_id ...
But when I write the same select query on sql prompt I get the data .. what that means is my trigger fires before a record with that list_line_id is inserted into qp_pricing_attributes. Ideally as soon as i insert a record into the qp_list_line(the table on which trigger is written) a record with same list_line_id should be inserted into qp_pricing_attributes first(inbuilt trigger by oracle apps),but my custom trigger is firing before this thus I am not able to get data in select query ...
But when I run this same query on sql prompt afterwards i get the data as by now the row is inserted into the qp_pricing_attributes table...
Thus I want a way to delay the firing of my trigger ... IS their any way or some solution....
Dream as if u'll live forever..Live as if u'll die today.
Click Here to Expand Forum to Full Width