[Home] [Help]
1088:
1089: begin
1090: select risk_association_id
1091: into l_risk_association_id
1092: from amw_risk_associations
1093: where object_type='PROCESS_ORG'
1094: and pk1=p_process_organization_id
1095: and risk_id=p_risk_id;
1096:
1097: open c1(p_batch_id,p_rcm_org_intf_id);
1098: fetch c1 into l_c1_type;
1099: close c1;
1100: fnd_file.put_line(fnd_file.LOG, 'After Select, l_risk_association_id: '||l_risk_association_id);
1101: fnd_file.put_line(fnd_file.LOG, 'UPDATING AMW_RISK_ASSOCIATIONS');
1102: UPDATE AMW_RISK_ASSOCIATIONS
1103: SET OBJECT_VERSION_NUMBER=OBJECT_VERSION_NUMBER+1
1104: ,RISK_LIKELIHOOD_CODE=L_C1_TYPE.RISK_LIKELIHOOD_CODE
1105: ,RISK_IMPACT_CODE=L_C1_TYPE.RISK_IMPACT_CODE
1098: fetch c1 into l_c1_type;
1099: close c1;
1100: fnd_file.put_line(fnd_file.LOG, 'After Select, l_risk_association_id: '||l_risk_association_id);
1101: fnd_file.put_line(fnd_file.LOG, 'UPDATING AMW_RISK_ASSOCIATIONS');
1102: UPDATE AMW_RISK_ASSOCIATIONS
1103: SET OBJECT_VERSION_NUMBER=OBJECT_VERSION_NUMBER+1
1104: ,RISK_LIKELIHOOD_CODE=L_C1_TYPE.RISK_LIKELIHOOD_CODE
1105: ,RISK_IMPACT_CODE=L_C1_TYPE.RISK_IMPACT_CODE
1106: ,MATERIAL=L_C1_TYPE.MATERIAL
1109: ,LAST_UPDATED_BY=G_USER_ID
1110: ,LAST_UPDATE_LOGIN=G_LOGIN_ID
1111: WHERE RISK_ASSOCIATION_ID=L_RISK_ASSOCIATION_ID;
1112:
1113: fnd_file.put_line(fnd_file.LOG, 'UPDATED AMW_RISK_ASSOCIATIONS');
1114:
1115: exception
1116: when no_data_found then
1117: fnd_file.put_line(fnd_file.LOG, 'INSIDE NO_DATA_FOUND');
1114:
1115: exception
1116: when no_data_found then
1117: fnd_file.put_line(fnd_file.LOG, 'INSIDE NO_DATA_FOUND');
1118: select amw_risk_associations_s.nextval into l_risk_association_id from dual;
1119:
1120: open c1(p_batch_id,p_rcm_org_intf_id);
1121: fetch c1 into l_c1_type;
1122: close c1;
1120: open c1(p_batch_id,p_rcm_org_intf_id);
1121: fetch c1 into l_c1_type;
1122: close c1;
1123:
1124: fnd_file.put_line(fnd_file.LOG, 'VALUES TO BE INSERTED INTO AMW_RISK_ASSOCIATIONS');
1125: FND_FILE.PUT_LINE(FND_FILE.LOG, 'risk_association_id: '||l_risk_association_id);
1126: FND_FILE.PUT_LINE(FND_FILE.LOG, 'risk_id: '||p_risk_id);
1127: FND_FILE.PUT_LINE(FND_FILE.LOG, 'pk1: '||p_process_organization_id);
1128: FND_FILE.PUT_LINE(FND_FILE.LOG, 'risk_likelihood_code: '||l_c1_type.risk_likelihood_code);
1129: FND_FILE.PUT_LINE(FND_FILE.LOG, 'risk_IMPACT_code: '||l_c1_type.risk_IMPACT_code);
1130: FND_FILE.PUT_LINE(FND_FILE.LOG, 'MATERIAL: '||l_c1_type.material);
1131: FND_FILE.PUT_LINE(FND_FILE.LOG, 'material_value: '||l_c1_type.material_value);
1132:
1133: insert into amw_risk_associations(risk_association_id,
1134: last_update_date,
1135: last_updated_by,
1136: creation_date,
1137: created_by,
1144: risk_likelihood_code,
1145: risk_impact_code,
1146: material,
1147: material_value) values (
1148: ---amw_risk_associations_s.nextval,
1149: l_risk_association_id,
1150: sysdate,
1151: G_USER_ID,
1152: sysdate,
1197: pk1,
1198: object_type,
1199: object_version_number,
1200: effective_date_from) values (
1201: ---amw_risk_associations_s.nextval,
1202: l_CONTROL_association_id,
1203: sysdate,
1204: G_USER_ID,
1205: sysdate,
1313: THEN
1314: FND_MSG_PUB.initialize;
1315: END IF;
1316:
1317: -------------------------dbms_output.put_line('In amw_risk_associations: p_assoc_mode: '||p_assoc_mode);
1318: -- =========================================================================
1319: -- Validate Environment
1320: -- =========================================================================
1321: IF FND_GLOBAL.User_Id IS NULL
1334: where object_type='PROCESS_ORG'
1335: and pk1=l_process_organization_id
1336: and natural_account_id=l_aaa_row.natural_account_id;
1337:
1338: ----------------dbms_output.put_line('In amw_risk_associations: row_count: '||row_count);
1339: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1340: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1341:
1342: if row_count = 0 then
1335: and pk1=l_process_organization_id
1336: and natural_account_id=l_aaa_row.natural_account_id;
1337:
1338: ----------------dbms_output.put_line('In amw_risk_associations: row_count: '||row_count);
1339: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1340: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1341:
1342: if row_count = 0 then
1343: select amw_acct_associations_s.nextval into l_acct_assoc_id from dual;
1336: and natural_account_id=l_aaa_row.natural_account_id;
1337:
1338: ----------------dbms_output.put_line('In amw_risk_associations: row_count: '||row_count);
1339: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1340: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1341:
1342: if row_count = 0 then
1343: select amw_acct_associations_s.nextval into l_acct_assoc_id from dual;
1344:
1341:
1342: if row_count = 0 then
1343: select amw_acct_associations_s.nextval into l_acct_assoc_id from dual;
1344:
1345: --------------------dbms_output.put_line('In amw_risk_associations: inserting');
1346:
1347: insert into amw_acct_associations (acct_assoc_id,last_update_date,
1348: last_updated_by,creation_date,created_by,
1349: last_update_login,object_type,pk1,pk2,pk3,pk4,pk5,
1392: where acct_assoc_id=l_update.acct_assoc_id
1393: and object_type='PROCESS_ORG'
1394: and pk1=p_process_organization_id;
1395:
1396: ---------------------dbms_output.put_line('In amw_risk_associations: deleting');
1397:
1398: -- Standard check for p_commit
1399: IF FND_API.to_Boolean( p_commit )
1400: THEN
1502: effective_date_to,risk_likelihood_code,risk_impact_code
1503: ---added by npanandi on 01/22/2004 for 3362371 bug fix
1504: ,material,material_value
1505: ---finished addition on 01/22/2004
1506: from amw_risk_associations
1507: where object_type='PROCESS'
1508: and pk1=l_process_id;
1509: l_ara_row c1%rowtype;
1510:
1509: l_ara_row c1%rowtype;
1510:
1511: cursor c2 is
1512: select risk_association_id,risk_id
1513: from amw_risk_associations where object_type='PROCESS_ORG'
1514: and pk1=l_process_organization_id; ---and risk_id=;
1515: l_update c2%rowtype;
1516:
1517: row_count number := 0;
1525: THEN
1526: FND_MSG_PUB.initialize;
1527: END IF;
1528:
1529: -------------------------dbms_output.put_line('In amw_risk_associations: p_assoc_mode: '||p_assoc_mode);
1530: -- =========================================================================
1531: -- Validate Environment
1532: -- =========================================================================
1533: IF FND_GLOBAL.User_Id IS NULL
1541: loop
1542: fetch c1 into l_ara_row;
1543: exit when c1%notfound;
1544:
1545: select count(*) into row_count from amw_risk_associations
1546: where object_type='PROCESS_ORG'
1547: and pk1=l_process_organization_id
1548: and risk_id=l_ara_row.risk_id;
1549:
1546: where object_type='PROCESS_ORG'
1547: and pk1=l_process_organization_id
1548: and risk_id=l_ara_row.risk_id;
1549:
1550: ----------------dbms_output.put_line('In amw_risk_associations: row_count: '||row_count);
1551: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1552: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1553:
1554: if row_count = 0 then
1547: and pk1=l_process_organization_id
1548: and risk_id=l_ara_row.risk_id;
1549:
1550: ----------------dbms_output.put_line('In amw_risk_associations: row_count: '||row_count);
1551: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1552: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1553:
1554: if row_count = 0 then
1555: select amw_risk_associations_s.nextval into l_risk_association_id from dual;
1548: and risk_id=l_ara_row.risk_id;
1549:
1550: ----------------dbms_output.put_line('In amw_risk_associations: row_count: '||row_count);
1551: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1552: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1553:
1554: if row_count = 0 then
1555: select amw_risk_associations_s.nextval into l_risk_association_id from dual;
1556:
1551: ---------------dbms_output.put_line('In amw_risk_associations: pk1: '||l_process_organization_id);
1552: --------------dbms_output.put_line('In amw_risk_associations: risk_id: '||l_ara_row.risk_id);
1553:
1554: if row_count = 0 then
1555: select amw_risk_associations_s.nextval into l_risk_association_id from dual;
1556:
1557: --------------------dbms_output.put_line('In amw_risk_associations: inserting');
1558:
1559: insert into amw_risk_associations (risk_association_id,last_update_date,
1553:
1554: if row_count = 0 then
1555: select amw_risk_associations_s.nextval into l_risk_association_id from dual;
1556:
1557: --------------------dbms_output.put_line('In amw_risk_associations: inserting');
1558:
1559: insert into amw_risk_associations (risk_association_id,last_update_date,
1560: last_updated_by,creation_date,created_by,
1561: last_update_login,risk_id,pk1,pk2,pk3,pk4,pk5,
1555: select amw_risk_associations_s.nextval into l_risk_association_id from dual;
1556:
1557: --------------------dbms_output.put_line('In amw_risk_associations: inserting');
1558:
1559: insert into amw_risk_associations (risk_association_id,last_update_date,
1560: last_updated_by,creation_date,created_by,
1561: last_update_login,risk_id,pk1,pk2,pk3,pk4,pk5,
1562: object_type,attribute_category,attribute1,attribute2,
1563: attribute3,attribute4,attribute5,attribute6,attribute7,
1613: loop
1614: fetch c2 into l_update;
1615: exit when c2%notfound;
1616:
1617: delete from amw_risk_associations
1618: where risk_association_id=l_update.risk_association_id
1619: and object_type='PROCESS_ORG'
1620: and pk1=p_process_organization_id;
1621:
1618: where risk_association_id=l_update.risk_association_id
1619: and object_type='PROCESS_ORG'
1620: and pk1=p_process_organization_id;
1621:
1622: ---------------------dbms_output.put_line('In amw_risk_associations: deleting');
1623:
1624: -- Standard check for p_commit
1625: IF FND_API.to_Boolean( p_commit )
1626: THEN
1964:
1965: --mpande added 11/14/2003
1966: cursor c2 is
1967: select ap_association_id,audit_procedure_id
1968: from amw_process_organization apo, amw_risk_associations ara, amw_control_associations aca, amw_ap_associations apa
1969: where apo.process_organization_id = ara.pk1
1970: and ara.risk_association_id = aca.pk1
1971: and aca.control_association_id = p_control_association_id
1972: and apa.pk1 = apo.organization_id
2009: exit when c1%notfound;
2010:
2011: select apo.process_id, apo.organization_id
2012: into l_process_id, l_org_id
2013: from amw_process_organization apo, amw_risk_associations ara, amw_control_associations aca
2014: where apo.process_organization_id = ara.pk1
2015: and ara.risk_association_id = aca.pk1
2016: and aca.control_association_id = p_control_association_id;
2017: