7: -- Function :
8: -- Pre-reqs : None.
9: -- Parameters :
10: -- IN p_api_version IN NUMBER Required
11: -- p_init_msg_list IN VARCHAR2 Optional Default = FND_API.G_FALSE
12: -- p_commit IN VARCHAR2 Optional Default = FND_API.G_FALSE
13: -- p_validation_level IN NUMBER Optional Default = FND_API.G_VALID_LEVEL_FULL
14: --
15: -- p_application_id IN NUMBER Optional Default = 401 (INV)
8: -- Pre-reqs : None.
9: -- Parameters :
10: -- IN p_api_version IN NUMBER Required
11: -- p_init_msg_list IN VARCHAR2 Optional Default = FND_API.G_FALSE
12: -- p_commit IN VARCHAR2 Optional Default = FND_API.G_FALSE
13: -- p_validation_level IN NUMBER Optional Default = FND_API.G_VALID_LEVEL_FULL
14: --
15: -- p_application_id IN NUMBER Optional Default = 401 (INV)
16: -- p_descr_flexfield_name IN VARCHAR2 Opt Default = 'MTL_EAM_ASSET_ATTR_VALUES'
9: -- Parameters :
10: -- IN p_api_version IN NUMBER Required
11: -- p_init_msg_list IN VARCHAR2 Optional Default = FND_API.G_FALSE
12: -- p_commit IN VARCHAR2 Optional Default = FND_API.G_FALSE
13: -- p_validation_level IN NUMBER Optional Default = FND_API.G_VALID_LEVEL_FULL
14: --
15: -- p_application_id IN NUMBER Optional Default = 401 (INV)
16: -- p_descr_flexfield_name IN VARCHAR2 Opt Default = 'MTL_EAM_ASSET_ATTR_VALUES'
17: -- p_search_set_id IN NUMBER
15: -- p_application_id IN NUMBER Optional Default = 401 (INV)
16: -- p_descr_flexfield_name IN VARCHAR2 Opt Default = 'MTL_EAM_ASSET_ATTR_VALUES'
17: -- p_search_set_id IN NUMBER
18: -- p_where_clause IN VARCHAR2
19: -- p_purge_option IN VARCHAR2 Optional Default = FND_API.G_FALSE
20: -- OUT x_return_status OUT VARCHAR2(1)
21: -- x_msg_count OUT NUMBER
22: -- x_msg_data OUT VARCHAR2(2000)
23: --
49:
50: PROCEDURE BUILD_SEARCH_SQL
51: (
52: p_api_version IN NUMBER,
53: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
54: p_commit IN VARCHAR2 := fnd_api.g_false,
55: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
56: p_application_id IN NUMBER := 401,
57: p_descr_flexfield_name IN VARCHAR2 := 'MTL_EAM_ASSET_ATTR_VALUES',
50: PROCEDURE BUILD_SEARCH_SQL
51: (
52: p_api_version IN NUMBER,
53: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
54: p_commit IN VARCHAR2 := fnd_api.g_false,
55: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
56: p_application_id IN NUMBER := 401,
57: p_descr_flexfield_name IN VARCHAR2 := 'MTL_EAM_ASSET_ATTR_VALUES',
58: p_search_set_id IN NUMBER,
51: (
52: p_api_version IN NUMBER,
53: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
54: p_commit IN VARCHAR2 := fnd_api.g_false,
55: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
56: p_application_id IN NUMBER := 401,
57: p_descr_flexfield_name IN VARCHAR2 := 'MTL_EAM_ASSET_ATTR_VALUES',
58: p_search_set_id IN NUMBER,
59: p_where_clause IN VARCHAR2 := NULL,
56: p_application_id IN NUMBER := 401,
57: p_descr_flexfield_name IN VARCHAR2 := 'MTL_EAM_ASSET_ATTR_VALUES',
58: p_search_set_id IN NUMBER,
59: p_where_clause IN VARCHAR2 := NULL,
60: p_purge_option IN VARCHAR2 := fnd_api.g_false,
61: x_sql_stmt OUT NOCOPY VARCHAR2,
62: x_return_status OUT NOCOPY VARCHAR2,
63: x_msg_count OUT NOCOPY NUMBER,
64: x_msg_data OUT NOCOPY VARCHAR2
101: SAVEPOINT build_search_sql_pvt;
102:
103: l_stmt_num := 20;
104: -- Standard call to check for call compatibility.
105: IF NOT fnd_api.compatible_api_call(
106: l_api_version
107: ,p_api_version
108: ,l_api_name
109: ,g_pkg_name) THEN
106: l_api_version
107: ,p_api_version
108: ,l_api_name
109: ,g_pkg_name) THEN
110: RAISE fnd_api.g_exc_unexpected_error;
111: END IF;
112:
113: l_stmt_num := 30;
114: -- Initialize message list if p_init_msg_list is set to TRUE.
111: END IF;
112:
113: l_stmt_num := 30;
114: -- Initialize message list if p_init_msg_list is set to TRUE.
115: IF fnd_api.to_boolean(p_init_msg_list) THEN
116: fnd_msg_pub.initialize;
117: END IF;
118:
119: l_stmt_num := 40;
117: END IF;
118:
119: l_stmt_num := 40;
120: -- Initialize API return status to success
121: x_return_status := fnd_api.g_ret_sts_success;
122: x_sql_stmt := NULL;
123: l_sql_stmt := NULL;
124:
125: l_stmt_num := 50;
132: fnd_message.set_name('EAM', 'EAM_INPUT_PARAMS_NULL');
133: fnd_message.set_token('EAM_DEBUG',l_full_name||'('||l_stmt_num||')');
134: fnd_msg_pub.add;
135: l_sql_stmt := NULL;
136: RAISE fnd_api.g_exc_error;
137: END IF;
138:
139: l_context_counter := 0;
140: l_counter := 0;
220: l_counter := 0;
221:
222: l_stmt_num := 150;
223: -- Purge Search Criteria from Temp table
224: IF fnd_api.to_boolean(p_purge_option) THEN
225: DELETE MTL_EAM_ASSET_SEARCH_TEMP
226: WHERE SEARCH_SET_ID = p_search_set_id;
227: END IF;
228:
240: l_stmt_num := 998;
241:
242: -- End of API body.
243: -- Standard check of p_commit.
244: IF fnd_api.to_boolean(p_commit) THEN
245: COMMIT WORK;
246: END IF;
247:
248: l_stmt_num := 999;
247:
248: l_stmt_num := 999;
249: -- Standard call to get message count and if count is 1, get message info.
250: fnd_msg_pub.count_and_get(
251: p_encoded => fnd_api.g_false
252: ,p_count => x_msg_count
253: ,p_data => x_msg_data);
254:
255:
253: ,p_data => x_msg_data);
254:
255:
256: EXCEPTION
257: WHEN fnd_api.g_exc_error THEN
258: ROLLBACK TO build_search_sql_pvt;
259: x_return_status := fnd_api.g_ret_sts_error;
260: x_sql_stmt := l_sql_stmt;
261: fnd_msg_pub.count_and_get(
255:
256: EXCEPTION
257: WHEN fnd_api.g_exc_error THEN
258: ROLLBACK TO build_search_sql_pvt;
259: x_return_status := fnd_api.g_ret_sts_error;
260: x_sql_stmt := l_sql_stmt;
261: fnd_msg_pub.count_and_get(
262: p_encoded => fnd_api.g_false
263: ,p_count => x_msg_count
258: ROLLBACK TO build_search_sql_pvt;
259: x_return_status := fnd_api.g_ret_sts_error;
260: x_sql_stmt := l_sql_stmt;
261: fnd_msg_pub.count_and_get(
262: p_encoded => fnd_api.g_false
263: ,p_count => x_msg_count
264: ,p_data => x_msg_data);
265: WHEN fnd_api.g_exc_unexpected_error THEN
266: ROLLBACK TO build_search_sql_pvt;
261: fnd_msg_pub.count_and_get(
262: p_encoded => fnd_api.g_false
263: ,p_count => x_msg_count
264: ,p_data => x_msg_data);
265: WHEN fnd_api.g_exc_unexpected_error THEN
266: ROLLBACK TO build_search_sql_pvt;
267: x_return_status := fnd_api.g_ret_sts_unexp_error;
268: x_sql_stmt := l_sql_stmt;
269: fnd_msg_pub.count_and_get(
263: ,p_count => x_msg_count
264: ,p_data => x_msg_data);
265: WHEN fnd_api.g_exc_unexpected_error THEN
266: ROLLBACK TO build_search_sql_pvt;
267: x_return_status := fnd_api.g_ret_sts_unexp_error;
268: x_sql_stmt := l_sql_stmt;
269: fnd_msg_pub.count_and_get(
270: p_encoded => fnd_api.g_false
271: ,p_count => x_msg_count
266: ROLLBACK TO build_search_sql_pvt;
267: x_return_status := fnd_api.g_ret_sts_unexp_error;
268: x_sql_stmt := l_sql_stmt;
269: fnd_msg_pub.count_and_get(
270: p_encoded => fnd_api.g_false
271: ,p_count => x_msg_count
272: ,p_data => x_msg_data);
273: WHEN OTHERS THEN
274: ROLLBACK TO build_search_sql_pvt;
271: ,p_count => x_msg_count
272: ,p_data => x_msg_data);
273: WHEN OTHERS THEN
274: ROLLBACK TO build_search_sql_pvt;
275: x_return_status := fnd_api.g_ret_sts_unexp_error;
276: x_sql_stmt := l_sql_stmt;
277:
278: IF fnd_msg_pub.check_msg_level(
279: fnd_msg_pub.g_msg_lvl_unexp_error) THEN
280: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name||'('||l_stmt_num||')');
281: END IF;
282:
283: fnd_msg_pub.count_and_get(
284: p_encoded => fnd_api.g_false
285: ,p_count => x_msg_count
286: ,p_data => x_msg_data);
287:
288: */