152: SELECT Decode(x_ORG_ID, FND_API.G_MISS_NUM, NULL,
153: Ltrim(Rtrim(x_ORG_ID)))
154: INTO l_ORG_ID FROM sys.dual;
155:
156: insert into CN_RULES_ALL_B
157: (
158: PACKAGE_ID,
159: RULE_ID,
160: RULESET_ID,
252: X_OBJECT_VERSION_NO IN OUT NOCOPY NUMBER
253: ) is
254: begin
255: X_OBJECT_VERSION_NO:=X_OBJECT_VERSION_NO+1;
256: update CN_RULES_ALL_B set
257: PACKAGE_ID = X_PACKAGE_ID,
258: REVENUE_CLASS_ID = X_REVENUE_CLASS_ID,
259: expense_ccid = x_expense_ccid,
260: liability_ccid = x_liability_ccid,
313: if (sql%notfound) then
314: raise no_data_found;
315: end if;
316:
317: delete from CN_RULES_ALL_B
318: where RULE_ID = X_RULE_ID
319: and ruleset_id = x_ruleset_id AND
320: ORG_ID=X_ORG_ID;
321:
343: begin
344: delete from CN_RULES_ALL_TL T
345: where not exists
346: (select NULL
347: from CN_RULES_ALL_B B
348: where B.RULE_ID = T.RULE_ID
349: and B.RULESET_ID = T.ruleset_id
350: and B.ORG_ID= T.ORG_ID
351: );
894: ELSE
895: user_id := 0;
896: END IF;
897: -- Load The record to _B table
898: UPDATE cn_rules_all_b SET
899: ruleset_id = x_ruleset_id,
900: revenue_class_id = x_revenue_class_id,
901: package_id = x_package_id,
902: last_update_date = sysdate,
906: WHERE rule_id = x_rule_id AND ruleset_id = x_ruleset_id AND ORG_ID=x_org_id;
907:
908: IF (SQL%NOTFOUND) THEN
909: -- Insert new record to _B table
910: INSERT INTO cn_rules_all_b
911: (rule_id,
912: ruleset_id,
913: revenue_class_id,
914: package_id,