[Home] [Help]
45: -- Cursor to get cost_layer_id from CPIC
46: -- This is to check the existence of atleast one record
47: CURSOR c_cpic_cost_layer IS
48: SELECT cost_layer_id
49: FROM cst_pac_item_costs
50: WHERE pac_period_id = i_pac_period_id
51: AND inventory_item_id = i_item_id
52: AND cost_group_id = i_cost_group_id;
53:
225: IF ( l_cost_layer_id = 0) THEN
226: l_stmt_num := 20;
227: /*
228: ** if the cost_layer_id is 0, then the layer doesn't exist, so we
229: ** should create it in cst_pac_item_costs and cst_pac_quantity_layers
230: */
231: SELECT cst_pac_item_costs_s.nextval
232: INTO l_cost_layer_id
233: FROM dual;
227: /*
228: ** if the cost_layer_id is 0, then the layer doesn't exist, so we
229: ** should create it in cst_pac_item_costs and cst_pac_quantity_layers
230: */
231: SELECT cst_pac_item_costs_s.nextval
232: INTO l_cost_layer_id
233: FROM dual;
234:
235: l_stmt_num := 30;
237: INTO l_quantity_layer_id
238: FROM dual;
239:
240: l_stmt_num := 40;
241: INSERT INTO cst_pac_item_costs (
242: cost_layer_id,
243: pac_period_id,
244: inventory_item_id,
245: cost_group_id,