181: -- Ensure the AAD to be exported is not modified from a leapfrog version
182: -- (h.version_num = b.version_num and leapfrog_flag = 'Y')
183: CURSOR c_aad IS
184: SELECT distinct t.name
185: FROM xla_aads_h h
186: ,xla_product_rules_b b
187: ,xla_product_rules_tl t
188: WHERE t.application_id = b.application_id
189: AND t.amb_context_code = b.amb_context_code
473: -- or is modified from a leapfrog version
474: -- (h.version_num = b.version_num and leapfrog_flag = 'Y')
475: CURSOR c_aad IS
476: SELECT 1
477: FROM xla_aads_h h
478: ,xla_product_rules_b b
479: WHERE h.application_id = b.application_id
480: AND h.product_rule_type_code = b.product_rule_type_code
481: AND h.product_rule_code = b.product_rule_code
792: ,b.version_num
793: ,b.updated_flag
794: ,NVL(h.leapfrog_flag,'N') leapfrog_flag
795: FROM xla_product_rules_b b
796: JOIN xla_aads_h h
797: ON h.product_rule_code = b.product_rule_code
798: AND h.application_id = p_application_id
799: AND h.product_rule_type_code = p_owner_type
800: JOIN (SELECT product_rule_code, max(version_num) max_version_num
797: ON h.product_rule_code = b.product_rule_code
798: AND h.application_id = p_application_id
799: AND h.product_rule_type_code = p_owner_type
800: JOIN (SELECT product_rule_code, max(version_num) max_version_num
801: FROM xla_aads_h
802: WHERE application_id = p_application_id
803: AND product_rule_type_code = p_owner_type
804: GROUP BY product_rule_code) h2
805: ON h.product_rule_code = h2.product_rule_code
813: ,b.version_num
814: ,b.updated_flag
815: ,NVL(h.leapfrog_flag,'N') leapfrog_flag
816: FROM xla_product_rules_b b
817: LEFT OUTER JOIN xla_aads_h h
818: ON h.product_rule_code = b.product_rule_code
819: AND h.application_id = p_application_id
820: AND h.product_rule_type_code = p_owner_type
821: WHERE b.application_id = p_application_id
1437: grp.product_rule_code
1438: ,grp.version_num version_from
1439: ,(MAX(NVL(h.version_num,0)) OVER (PARTITION BY grp.group_num))+1 version_to
1440: FROM TABLE(CAST(g_aad_groups AS xla_aad_group_tbl_type)) grp
1441: , xla_aads_h h
1442: WHERE h.application_id(+) = p_application_id
1443: AND h.product_rule_type_code(+) = p_owner_type
1444: AND h.product_rule_code(+) = grp.product_rule_code
1445: AND grp.group_num IN
1451: CURSOR c_aad_unchanged IS
1452: SELECT grp.product_rule_code
1453: , max(h.version_num) version_to
1454: FROM TABLE(CAST(g_aad_groups AS xla_aad_group_tbl_type)) grp
1455: , xla_aads_h h
1456: WHERE h.application_id = p_application_id
1457: AND h.product_rule_type_code = p_owner_type
1458: AND h.product_rule_code = grp.product_rule_code
1459: AND NOT EXISTS
1515: p_level => C_LEVEL_EVENT);
1516: END IF;
1517:
1518: FORALL i IN 1 .. l_aad_codes.COUNT
1519: INSERT INTO xla_aads_h
1520: (application_id
1521: ,product_rule_type_code
1522: ,product_rule_code
1523: ,version_num
1555: ,xla_environment_pkg.g_prog_id
1556: ,xla_environment_pkg.g_req_Id);
1557:
1558: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1559: trace(p_msg => '# row inserted in xla_aads_h = '||SQL%ROWCOUNT,
1560: p_module => l_log_module,
1561: p_level => C_LEVEL_STATEMENT);
1562: END IF;
1563:
1608: p_level => C_LEVEL_STATEMENT);
1609: END IF;
1610:
1611: FORALL i IN 1 .. l_aad_codes.COUNT
1612: UPDATE xla_aads_h
1613: SET user_version = p_user_version
1614: , version_comment = p_version_comment
1615: , program_update_date = sysdate
1616: , program_application_id = xla_environment_pkg.g_prog_appl_id
1623: AND (NVL(user_version,C_CHAR) <> NVL(p_user_version,C_CHAR) OR
1624: NVL(version_comment,C_CHAR) <> NVL(p_version_comment,C_CHAR));
1625:
1626: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1627: trace(p_msg => '# row updated in xla_aads_h = '||SQL%ROWCOUNT,
1628: p_module => l_log_module,
1629: p_level => C_LEVEL_STATEMENT);
1630: END IF;
1631: