1: package body AK_QUERYOBJ_PVT as
2: /* $Header: akdvqryb.pls 120.4 2005/09/15 22:46:14 tshort ship $ */
3:
4: --=======================================================
5: -- Procedure WRITE_LINES_TO_BUFFER (local procedure)
737:
738: savepoint start_create_queryobj;
739:
740: --** check to see if row already exists **
741: if AK_QUERYOBJ_PVT.QUERY_OBJECT_EXISTS (
742: p_api_version_number => 1.0,
743: p_return_status => l_return_status,
744: p_query_code => p_query_code,
745: p_application_id => p_application_id) then
924:
925: savepoint start_create_line;
926:
927: --** check to see if row already exists **
928: if AK_QUERYOBJ_PVT.LINE_EXISTS (
929: p_api_version_number => 1.0,
930: p_return_status => l_return_status,
931: p_query_code => p_query_code,
932: p_seq_num => p_seq_num) then
1977: --
1978: if (l_query_tbl.count > 0) then
1979: for l_index in l_query_tbl.FIRST .. l_query_tbl.LAST loop
1980: if (l_query_tbl.exists(l_index)) then
1981: if AK_QUERYOBJ_PVT.QUERY_OBJECT_EXISTS (
1982: p_api_version_number => 1.0,
1983: p_return_status => l_return_status,
1984: p_query_code => l_query_tbl(l_index).query_code,
1985: p_application_id => l_query_tbl(l_index).application_id
1987: --
1988: -- Update Query Objects only if G_UPDATE_MODE is TRUE
1989: --
1990: if (AK_UPLOAD_GRP.G_UPDATE_MODE) then
1991: AK_QUERYOBJ_PVT.UPDATE_QUERY_OBJECT (
1992: p_validation_level => p_validation_level,
1993: p_api_version_number => 1.0,
1994: p_msg_count => l_msg_count,
1995: p_msg_data => l_msg_data,
2023: p_db_last_update_date => l_update1,
2024: p_last_update_login => l_query_tbl(l_index).last_update_login,
2025: p_create_or_update => 'UPDATE') then
2026:
2027: AK_QUERYOBJ_PVT.UPDATE_QUERY_OBJECT (
2028: p_validation_level => p_validation_level,
2029: p_api_version_number => 1.0,
2030: p_msg_count => l_msg_count,
2031: p_msg_data => l_msg_data,
2042: );
2043: end if; -- /* if ( l_user_id1 = 1 ) */
2044: end if; -- /* if G_UPDATE_MODE G_NC_UPDATE_MODE*/
2045: else
2046: AK_QUERYOBJ_PVT.CREATE_QUERY_OBJECT (
2047: p_validation_level => p_validation_level,
2048: p_api_version_number => 1.0,
2049: p_msg_count => l_msg_count,
2050: p_msg_data => l_msg_data,
2087: --
2088: if (l_line_tbl.count > 0) then
2089: for l_index in l_line_tbl.FIRST .. l_line_tbl.LAST loop
2090: if (l_line_tbl.exists(l_index)) then
2091: if AK_QUERYOBJ_PVT.LINE_EXISTS (
2092: p_api_version_number => 1.0,
2093: p_return_status => l_return_status,
2094: p_query_code => l_line_tbl(l_index).query_code,
2095: p_seq_num =>l_line_tbl(l_index).seq_num ) then
2096: --
2097: -- Update Query object lines only if G_UPDATE_MODE is TRUE
2098: --
2099: if (AK_UPLOAD_GRP.G_UPDATE_MODE) then
2100: AK_QUERYOBJ_PVT.UPDATE_QUERY_OBJECT_LINE (
2101: p_validation_level => p_validation_level,
2102: p_api_version_number => 1.0,
2103: p_msg_count => l_msg_count,
2104: p_msg_data => l_msg_data,
2134: p_db_last_update_date => l_update1,
2135: p_last_update_login => l_line_tbl(l_index).last_update_login,
2136: p_create_or_update => 'UPDATE') then
2137:
2138: AK_QUERYOBJ_PVT.UPDATE_QUERY_OBJECT_LINE (
2139: p_validation_level => p_validation_level,
2140: p_api_version_number => 1.0,
2141: p_msg_count => l_msg_count,
2142: p_msg_data => l_msg_data,
2156: );
2157: end if; /* if l_user_id1 = 1 and l_user_id2 = 1 */
2158: end if; -- /* if G_UPDATE_MODE G_NO_CUSTOM_UPDATE */
2159: else
2160: AK_QUERYOBJ_PVT.CREATE_QUERY_OBJECT_LINE (
2161: p_validation_level => p_validation_level,
2162: p_api_version_number => 1.0,
2163: p_msg_count => l_msg_count,
2164: p_msg_data => l_msg_data,
2226: SUBSTR (SQLERRM, 1, 240) );
2227: FND_MSG_PUB.Add;
2228: end UPLOAD_QUERY_OBJECT;
2229:
2230: end AK_QUERYOBJ_PVT;