1002: l_Org_Id := Template_Rec.Org_Id;
1003: l_Intent := Template_Rec.Intent;
1004: END LOOP;
1005: /*
1006: Delete questions from the table OKC_XPRT_QUESTION_ORDERS for the template where the questions do not exist in
1007: the left and right hand side of OKC_XPRT_RULE_CONDITIONS or in OKC_XPRT_RULE_OUTCOMES
1008: for all rules associated to the template in table OKC_XPRT_TEMPLATE_RULES or rules
1009: with ORG_WIDE_FLAG='Y' and status in ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGPUB')
1010: */
1012: -- write to debug log file
1013: IF (Fnd_Log.Level_Procedure >= Fnd_Log.g_Current_Runtime_Level) THEN
1014: Fnd_Log.STRING(Fnd_Log.Level_Procedure,
1015: g_Module || l_Api_Name,
1016: '110: Deleting invalid questions from the table Okc_Xprt_Question_Orders');
1017: END IF;
1018:
1019:
1020: DELETE FROM Okc_Xprt_Question_Orders
1016: '110: Deleting invalid questions from the table Okc_Xprt_Question_Orders');
1017: END IF;
1018:
1019:
1020: DELETE FROM Okc_Xprt_Question_Orders
1021: WHERE Template_Id = p_Template_Id
1022: AND NOT EXISTS
1023: (SELECT 1
1024: FROM Okc_Xprt_Rule_Conditions Cond,
1027: Okc_xprt_questions_b quest
1028: WHERE Rules.Rule_Id = Cond.Rule_Id
1029: AND Rules.Rule_Id = Assoc.Rule_Id
1030: AND Assoc.Template_Id = p_Template_Id
1031: AND ( ( to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Code
1032: AND Cond.Object_Type = 'QUESTION') OR
1033: (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Value_Code
1034: AND Cond.Object_Value_Type = 'QUESTION')
1035: )
1029: AND Rules.Rule_Id = Assoc.Rule_Id
1030: AND Assoc.Template_Id = p_Template_Id
1031: AND ( ( to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Code
1032: AND Cond.Object_Type = 'QUESTION') OR
1033: (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Value_Code
1034: AND Cond.Object_Value_Type = 'QUESTION')
1035: )
1036: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1037: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1032: AND Cond.Object_Type = 'QUESTION') OR
1033: (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Value_Code
1034: AND Cond.Object_Value_Type = 'QUESTION')
1035: )
1036: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1037: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1038: UNION ALL --perf Bug#5030444 Replaced UNION with UNION ALL
1039: SELECT 1
1040: FROM Okc_Xprt_Rule_Outcomes Outs,
1043: Okc_xprt_questions_b quest
1044: WHERE Rules.Rule_Id = Assoc.Rule_Id
1045: AND Rules.rule_id = Outs.rule_id
1046: AND Assoc.Template_Id = p_Template_Id
1047: AND to_char(Okc_Xprt_Question_Orders.Question_Id) =
1048: Outs.Object_Value_Id
1049: AND Outs.Object_Type = 'QUESTION'
1050: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1051: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1046: AND Assoc.Template_Id = p_Template_Id
1047: AND to_char(Okc_Xprt_Question_Orders.Question_Id) =
1048: Outs.Object_Value_Id
1049: AND Outs.Object_Type = 'QUESTION'
1050: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1051: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1052: UNION ALL --perf Bug#5030444 Replaced UNION with UNION ALL
1053: SELECT 1
1054: FROM Okc_Xprt_Rule_Conditions Cond, okc_xprt_rule_hdrs_all Rules,
1056: WHERE Rules.Rule_Id = Cond.Rule_Id
1057: AND Rules.Org_Wide_Flag = 'Y'
1058: AND Rules.Org_Id = l_Org_Id
1059: AND Rules.Intent = l_Intent
1060: AND ( (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Code
1061: AND Cond.Object_Type = 'QUESTION') OR
1062: (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Value_Code
1063: AND Cond.Object_Value_Type = 'QUESTION')
1064: )
1058: AND Rules.Org_Id = l_Org_Id
1059: AND Rules.Intent = l_Intent
1060: AND ( (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Code
1061: AND Cond.Object_Type = 'QUESTION') OR
1062: (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Value_Code
1063: AND Cond.Object_Value_Type = 'QUESTION')
1064: )
1065: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1066: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1061: AND Cond.Object_Type = 'QUESTION') OR
1062: (to_char(Okc_Xprt_Question_Orders.Question_Id) = Cond.Object_Value_Code
1063: AND Cond.Object_Value_Type = 'QUESTION')
1064: )
1065: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1066: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1067: UNION ALL --perf Bug#5030444 Replaced UNION with UNION ALL
1068: SELECT 1
1069: FROM Okc_Xprt_Rule_Outcomes Outs, okc_xprt_rule_hdrs_all Rules,
1071: WHERE Rules.Rule_Id = Outs.Rule_Id
1072: AND Rules.Org_Wide_Flag = 'Y'
1073: AND Rules.Org_Id = l_Org_Id
1074: AND Rules.Intent = l_Intent
1075: AND to_char(Okc_Xprt_Question_Orders.Question_Id) =
1076: Outs.Object_Value_Id
1077: AND Outs.Object_Type = 'QUESTION'
1078: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1079: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1074: AND Rules.Intent = l_Intent
1075: AND to_char(Okc_Xprt_Question_Orders.Question_Id) =
1076: Outs.Object_Value_Id
1077: AND Outs.Object_Type = 'QUESTION'
1078: AND quest.question_id = Okc_Xprt_Question_Orders.Question_Id
1079: AND Rules.Status_Code IN ('ACTIVE', 'DRAFT', 'REVISION', 'PENDINGDISABLE','PENDINGPUB')
1080: );
1081:
1082: -- write to debug log file
1082: -- write to debug log file
1083: IF (Fnd_Log.Level_Procedure >= Fnd_Log.g_Current_Runtime_Level) THEN
1084: Fnd_Log.STRING(Fnd_Log.Level_Procedure,
1085: g_Module || l_Api_Name,
1086: '120: Deleted invalid questions from the table Okc_Xprt_Question_Orders');
1087: END IF;
1088: /*
1089: Initialize the statuses for the questions for the template
1090: */
1096: Fnd_Log.STRING(Fnd_Log.Level_Procedure,
1097: g_Module || l_Api_Name,
1098: '130: Initialize the status for the questions for the template.');
1099: END IF;
1100: UPDATE Okc_Xprt_Question_Orders
1101: SET Question_Rule_Status = 'DRAFT',
1102: Last_Updated_By = l_user_id,
1103: Last_Update_Date = SYSDATE,
1104: Last_Update_Login = l_login_id,
1187:
1188: BEGIN
1189:
1190: /*
1191: 3. Run a loop on the cursor to update/insert records into OKC_XPRT_QUESTION_ORDERS and set Draft_rule_qst_flag = 'ACTIVE' or 'DRAFT' based on the rule status.
1192:
1193: */
1194:
1195: FOR Question_Rec IN Active_Draft_Rule_Questions LOOP
1196:
1197: l_Question_Id := Question_Rec.Question_Id;
1198:
1199:
1200: UPDATE Okc_Xprt_Question_Orders
1201: SET Question_Rule_Status = DECODE(Question_Rec.Status_Code, 'ACTIVE','ACTIVE','DRAFT' ),
1202: Last_Updated_By = l_user_id,
1203: Last_Update_Date = SYSDATE,
1204: Last_Update_Login = l_login_id,
1207: AND Question_Id = l_Question_Id;
1208:
1209: IF SQL%NOTFOUND THEN
1210:
1211: INSERT INTO Okc_Xprt_Question_Orders
1212: (Question_Order_Id,
1213: Template_Id,
1214: Question_Id,
1215: Question_Rule_Status,
1220: Last_Updated_By,
1221: Last_Update_Date,
1222: Last_Update_Login)
1223: VALUES
1224: (OKC_XPRT_QUESTION_ORDERS_S.NEXTVAL,
1225: p_Template_Id,
1226: l_Question_Id,
1227: DECODE(Question_Rec.Status_Code, 'ACTIVE','ACTIVE','DRAFT'),
1228: DECODE(Question_Rec.Status_Code, 'ACTIVE','Y','N'),
1320: l_Question_Id NUMBER;
1321: BEGIN
1322:
1323: /*
1324: Run a loop on the cursor to update/insert records into OKC_XPRT_QUESTION_ORDERS and set QUESTION_RULE_STATUS = 'PENDINGPUB'.
1325:
1326: */
1327: FOR Question_Rec IN Pending_Rule_Questions LOOP
1328:
1328:
1329: l_Question_Id := Question_Rec.Question_Id;
1330:
1331:
1332: UPDATE Okc_Xprt_Question_Orders
1333: SET Question_Rule_Status = DECODE(Question_Rule_Status,'ACTIVE','ACTIVE','PENDINGPUB'),
1334: Last_Updated_By = l_user_id,
1335: Last_Update_Date = SYSDATE,
1336: Last_Update_Login = l_login_id,
1339: AND Question_Id = l_Question_Id ;
1340:
1341: IF SQL%NOTFOUND THEN
1342:
1343: INSERT INTO Okc_Xprt_Question_Orders
1344: (Question_Order_Id,
1345: Template_Id,
1346: Question_Id,
1347: Question_Rule_Status,
1352: Last_Updated_By,
1353: Last_Update_Date,
1354: Last_Update_Login)
1355: VALUES
1356: (OKC_XPRT_QUESTION_ORDERS_S.NEXTVAL,
1357: p_Template_Id,
1358: l_Question_Id,
1359: 'PENDINGPUB',
1360: 'N',
1375: For all other modes, only select 'ACTIVE' rules and 'PENDINGPUB' rules for the request id.
1376: */
1377:
1378:
1379: UPDATE Okc_Xprt_Question_Orders
1380: SET Mandatory_Flag = 'N',
1381: Last_Updated_By = l_user_id,
1382: Last_Update_Date = SYSDATE,
1383: Last_Update_Login = l_login_id
1392: END IF;
1393:
1394: --Fix for perf Bug#5030429.Breaking big Update stmt into 4 small Update stmts one for each subquery
1395: --Update stmt1: set mandatory_flag = 'Y' for those questions which appear in the conditions of non-org wide rule
1396: UPDATE Okc_Xprt_Question_Orders
1397: SET Mandatory_Flag = 'Y',
1398: Last_Updated_By = l_user_id,
1399: Last_Update_Date = SYSDATE,
1400: Last_Update_Login = l_login_id
1403: (SELECT Ord.Question_Id
1404: FROM Okc_Xprt_Rule_Conditions Cond,
1405: okc_xprt_rule_hdrs_all Rules,
1406: Okc_Xprt_Template_Rules Assoc,
1407: Okc_Xprt_Question_Orders Ord
1408: WHERE Rules.Rule_Id = Cond.Rule_Id
1409: AND Rules.Rule_Id = Assoc.Rule_Id
1410: AND Assoc.Template_Id = p_Template_Id
1411: AND (
1415: AND Cond.Object_Value_Type = 'QUESTION')
1416: )
1417: );
1418: --Update stmt2: set mandatory_flag = 'Y' for those questions which appear in the conditions of ORG wide rule
1419: UPDATE Okc_Xprt_Question_Orders
1420: SET Mandatory_Flag = 'Y',
1421: Last_Updated_By = l_user_id,
1422: Last_Update_Date = SYSDATE,
1423: Last_Update_Login = l_login_id
1425: AND Question_Id IN
1426: (SELECT Ord.Question_Id
1427: FROM Okc_Xprt_Rule_Conditions Cond,
1428: okc_xprt_rule_hdrs_all Rules,
1429: Okc_Xprt_Question_Orders Ord
1430: WHERE Rules.Rule_Id = Cond.Rule_Id
1431: AND Rules.Org_Wide_Flag = 'Y'
1432: AND Rules.Org_Id = l_Org_Id
1433: AND Rules.Intent = l_Intent
1438: AND Cond.Object_Value_Type = 'QUESTION')
1439: )
1440: );
1441: --Update stmt3: set mandatory_flag = 'N' for those questions which appear in the outcome of non-ORG wide rule
1442: UPDATE Okc_Xprt_Question_Orders
1443: SET Mandatory_Flag = 'N',
1444: Last_Updated_By = l_user_id,
1445: Last_Update_Date = SYSDATE,
1446: Last_Update_Login = l_login_id
1449: (SELECT Ord.Question_Id
1450: FROM Okc_Xprt_Rule_Outcomes Outs,
1451: okc_xprt_rule_hdrs_all Rules,
1452: Okc_Xprt_Template_Rules Assoc,
1453: Okc_Xprt_Question_Orders Ord
1454: WHERE Rules.Rule_Id = Assoc.Rule_Id
1455: AND Assoc.Template_Id = p_Template_Id
1456: AND to_char(Ord.Question_Id) = Outs.Object_Value_Id
1457: AND Outs.Object_Type = 'QUESTION'
1458: AND rules.rule_id = outs.rule_id
1459: AND rules.status_code <> 'INACTIVE' --Added for Bug#4108690
1460: );
1461: --Update stmt4: set mandatory_flag = 'N' for those questions which appear in the outcome of ORG wide rule
1462: UPDATE Okc_Xprt_Question_Orders
1463: SET Mandatory_Flag = 'N',
1464: Last_Updated_By = l_user_id,
1465: Last_Update_Date = SYSDATE,
1466: Last_Update_Login = l_login_id
1468: AND Question_Id IN
1469: (SELECT Ord.Question_Id
1470: FROM Okc_Xprt_Rule_Outcomes Outs,
1471: okc_xprt_rule_hdrs_all Rules,
1472: Okc_Xprt_Question_Orders Ord
1473: WHERE Rules.Rule_Id = Outs.Rule_Id
1474: AND Rules.Org_Wide_Flag = 'Y'
1475: AND Rules.Org_Id = l_Org_Id
1476: AND Rules.Intent = l_Intent
1487: END IF;
1488: --Fix for perf Bug#5030086.Breaking big Update stmt into 4 small Update stmts
1489: --Update stmt1: set mandatory_flag = 'Y' for those questions which appear in the conditions of
1490: --Org and non-Org wide rules and rule status is ACTIVE
1491: UPDATE Okc_Xprt_Question_Orders
1492: SET Mandatory_Flag = 'Y',
1493: Last_Updated_By = l_user_id,
1494: Last_Update_Date = SYSDATE,
1495: Last_Update_Login = l_login_id
1498: (SELECT Ord.Question_Id
1499: FROM Okc_Xprt_Rule_Conditions Cond,
1500: okc_xprt_rule_hdrs_all Rules,
1501: Okc_Xprt_Template_Rules Assoc,
1502: Okc_Xprt_Question_Orders Ord
1503: WHERE Rules.Rule_Id = Cond.Rule_Id
1504: AND Rules.Rule_Id = Assoc.Rule_Id
1505: AND Assoc.Template_Id = p_Template_Id
1506: AND (
1513: UNION
1514: SELECT Ord.Question_Id
1515: FROM Okc_Xprt_Rule_Conditions Cond,
1516: okc_xprt_rule_hdrs_all Rules,
1517: Okc_Xprt_Question_Orders Ord
1518: WHERE Rules.Rule_Id = Cond.Rule_Id
1519: AND Rules.Org_Wide_Flag = 'Y'
1520: AND Rules.Org_Id = l_Org_Id
1521: AND Rules.Intent = l_Intent
1528: AND Rules.Status_Code = 'ACTIVE');
1529:
1530: --Update stmt2: set mandatory_flag = 'Y' for those questions which appear in the conditions of
1531: --Org and non-Org wide rules and rule status is PENDINGPUB
1532: UPDATE Okc_Xprt_Question_Orders
1533: SET Mandatory_Flag = 'Y',
1534: Last_Updated_By = l_user_id,
1535: Last_Update_Date = SYSDATE,
1536: Last_Update_Login = l_login_id
1539: (SELECT Ord.Question_Id
1540: FROM Okc_Xprt_Rule_Conditions Cond,
1541: okc_xprt_rule_hdrs_all Rules,
1542: Okc_Xprt_Template_Rules Assoc,
1543: Okc_Xprt_Question_Orders Ord
1544: WHERE Rules.Rule_Id = Cond.Rule_Id
1545: AND Rules.Rule_Id = Assoc.Rule_Id
1546: AND Assoc.Template_Id = p_Template_Id
1547: AND (
1555: UNION
1556: SELECT Ord.Question_Id
1557: FROM Okc_Xprt_Rule_Conditions Cond,
1558: okc_xprt_rule_hdrs_all Rules,
1559: Okc_Xprt_Question_Orders Ord
1560: WHERE Rules.Rule_Id = Cond.Rule_Id
1561: AND Rules.Org_Wide_Flag = 'Y'
1562: AND Rules.Org_Id = l_Org_Id
1563: AND Rules.Intent = l_Intent
1570: AND Rules.Status_Code = 'PENDINGPUB'
1571: AND Rules.Request_Id = l_conc_request_id );
1572: --Update stmt3: set mandatory_flag = 'N' for those questions which appear in the Outcome Section of
1573: --Org and non-Org wide rules and rule status is ACTIVE
1574: UPDATE Okc_Xprt_Question_Orders
1575: SET Mandatory_Flag = 'N',
1576: Last_Updated_By = l_user_id,
1577: Last_Update_Date = SYSDATE,
1578: Last_Update_Login = l_login_id
1581: (SELECT Ord.Question_Id
1582: FROM Okc_Xprt_Rule_Outcomes Outs,
1583: okc_xprt_rule_hdrs_all Rules,
1584: Okc_Xprt_Template_Rules Assoc,
1585: Okc_Xprt_Question_Orders Ord
1586: WHERE Rules.Rule_Id = Assoc.Rule_Id
1587: AND Assoc.Template_Id = p_Template_Id
1588: AND to_char(Ord.Question_Id) = Outs.Object_Value_Id
1589: AND Outs.Object_Type = 'QUESTION'
1592: UNION
1593: SELECT Ord.Question_Id
1594: FROM Okc_Xprt_Rule_Outcomes Outs,
1595: okc_xprt_rule_hdrs_all Rules,
1596: Okc_Xprt_Question_Orders Ord
1597: WHERE Rules.Rule_Id = Outs.Rule_Id
1598: AND Rules.Org_Wide_Flag = 'Y'
1599: AND Rules.Org_Id = l_Org_Id
1600: AND Rules.Intent = l_Intent
1603: AND Rules.Status_Code = 'ACTIVE'
1604: AND rules.rule_id = outs.rule_id );
1605: --Update stmt4: set mandatory_flag = 'N' for those questions which appear in the Outcome Section of
1606: --Org and non-Org wide rules and rule status is PENDINGPUB
1607: UPDATE Okc_Xprt_Question_Orders
1608: SET Mandatory_Flag = 'N',
1609: Last_Updated_By = l_user_id,
1610: Last_Update_Date = SYSDATE,
1611: Last_Update_Login = l_login_id
1614: (SELECT Ord.Question_Id
1615: FROM Okc_Xprt_Rule_Outcomes Outs,
1616: okc_xprt_rule_hdrs_all Rules,
1617: Okc_Xprt_Template_Rules Assoc,
1618: Okc_Xprt_Question_Orders Ord
1619: WHERE Rules.Rule_Id = Assoc.Rule_Id
1620: AND Assoc.Template_Id = p_Template_Id
1621: AND to_char(Ord.Question_Id) = Outs.Object_Value_Id
1622: AND Outs.Object_Type = 'QUESTION'
1626: UNION
1627: SELECT Ord.Question_Id
1628: FROM Okc_Xprt_Rule_Outcomes Outs,
1629: okc_xprt_rule_hdrs_all Rules,
1630: Okc_Xprt_Question_Orders Ord
1631: WHERE Rules.Rule_Id = Outs.Rule_Id
1632: AND Rules.Org_Wide_Flag = 'Y'
1633: AND Rules.Org_Id = l_Org_Id
1634: AND Rules.Intent = l_Intent
1659: l_Max_Seq NUMBER :=0;
1660: l_Question_Id NUMBER;
1661: CURSOR Questions_For_Seq IS
1662: SELECT Question_Id
1663: FROM Okc_Xprt_Question_Orders
1664: WHERE Template_Id = p_Template_Id
1665: AND Sequence_Num IS NULL
1666: ORDER BY Mandatory_Flag DESC;
1667:
1668: BEGIN
1669: BEGIN
1670: SELECT MAX(Sequence_Num)
1671: INTO l_Max_Seq
1672: FROM Okc_Xprt_Question_Orders
1673: WHERE Template_Id = p_Template_Id;
1674: EXCEPTION
1675: WHEN OTHERS THEN
1676: l_Max_Seq := 0;
1681:
1682: l_Question_Id := Question_Rec.Question_Id;
1683:
1684:
1685: UPDATE Okc_Xprt_Question_Orders
1686: SET Sequence_Num = l_Max_Seq
1687: WHERE Template_Id = p_Template_Id
1688: AND Question_Id = l_Question_Id;
1689:
1784: Delete Production mode Publication
1785: DELETE the UI attached to the production publication
1786: Update Test mode Publication to Production mode
1787: Update Rule status in the current concurrent request id
1788: Update the runtime_available_flag in okc_xprt_question_orders table
1789: Delete records from okc_xprt_template_rules where deleted_flag = 'Y'
1790: commit the work
1791:
1792: This procedure can also be called in Template approval flow with mode 'TEMPLATE_APPROVAL'
1793: This procedure does the following in 'TEMPLATE_APPROVAL' mode:
1794: For the called template
1795: Delete Production mode Publication
1796: Update Test mode Publication to Production mode
1797: Update the runtime_available_flag in okc_xprt_question_orders table
1798: */
1799: PROCEDURE create_production_publication
1800: (
1801: p_calling_mode IN VARCHAR2,
2040: fnd_file.put_line(FND_FILE.LOG,' ');
2041:
2042: IF (p_calling_mode = 'PUBLISH') THEN
2043: -- Update all the Question order records that have question_rule_status as PENDINGPUB
2044: UPDATE Okc_Xprt_Question_Orders
2045: SET runtime_available_flag = 'Y',
2046: question_rule_status = 'ACTIVE',
2047: last_updated_by = FND_GLOBAL.USER_ID,
2048: last_update_date = SYSDATE,
2070: END IF; -- p_calling_mode = 'PUBLISH'
2071:
2072: IF p_calling_mode = 'TEMPLATE_APPROVAL' THEN
2073: -- if template approval then go by template id
2074: UPDATE Okc_Xprt_Question_Orders
2075: SET runtime_available_flag = 'Y',
2076: last_updated_by = FND_GLOBAL.USER_ID,
2077: last_update_date = SYSDATE,
2078: last_update_login = FND_GLOBAL.LOGIN_ID
8999:
9000: CURSOR c1 IS
9001: --Check if the Template has Active rules with questions
9002: SELECT 'X'
9003: FROM okc_xprt_question_orders
9004: WHERE question_rule_status = 'ACTIVE'
9005: AND template_id = p_template_id;
9006:
9007: l_value VARCHAR2(1) := 'N';
10639: LOOP
10640: FOR rec_question IN csr_questions(rec_rule.rule_id)
10641: LOOP
10642: SELECT 'x' into l_dummy
10643: FROM okc_xprt_question_orders
10644: WHERE question_rule_status = 'ACTIVE'
10645: AND template_id = p_template_id
10646: AND question_id = rec_question.question_id;
10647: