5: G_PKG_NAME CONSTANT VARCHAR2(30):='WMS_UTILITY_PVT';
6:
7: pg_file_name VARCHAR2(100) := NULL;
8: pg_path_name VARCHAR2(100) := NULL;
9: pg_fp utl_file.file_type;
10:
11: -- =====================================================
12: -- API name : Get_log_dir
13: -- Type : Private
10:
11: -- =====================================================
12: -- API name : Get_log_dir
13: -- Type : Private
14: -- Function : Get path name defined from utl_file_dir
15: -- =====================================================
16: PROCEDURE get_log_dir(
17: x_return_status OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
18: x_msg_count OUT NOCOPY /* file.sql.39 change */ NUMBER,
25:
26:
27: Cursor Get_FileDebugDir IS
28: select rtrim(ltrim(value)) from v$parameter
29: where upper(name) = 'UTL_FILE_DIR';
30:
31: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
32: BEGIN
33: open Get_FileDebugDir;
32: BEGIN
33: open Get_FileDebugDir;
34: fetch Get_FileDebugDir into l_write_dir;
35: IF(l_write_dir IS NULL) THEN
36: l_msg := 'Invalid directory defined in utl_file_dir';
37: RAISE Invalid_dir;
38: END IF;
39: close Get_FileDebugDir;
40:
65: BEGIN
66: if (pg_file_name is not null) then
67:
68: -- dbms_output.put_line('pg_file_name ' || pg_file_name);
69: utl_file.put_line(pg_fp, line);
70: utl_file.fflush(pg_fp);
71: end if;
72: END file_debug;
73:
66: if (pg_file_name is not null) then
67:
68: -- dbms_output.put_line('pg_file_name ' || pg_file_name);
69: utl_file.put_line(pg_fp, line);
70: utl_file.fflush(pg_fp);
71: end if;
72: END file_debug;
73:
74: -- ======================================================
87: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
88: BEGIN
89:
90: if (pg_file_name is null) then
91: pg_fp := utl_file.fopen(p_path_name, p_file_name, 'a',32767);
92: pg_file_name := p_file_name;
93: pg_path_name := p_path_name;
94: end if;
95:
93: pg_path_name := p_path_name;
94: end if;
95:
96: EXCEPTION
97: WHEN utl_file.invalid_path then
98: x_return_status := fnd_api.g_ret_sts_error;
99: fnd_msg_pub.count_and_get( p_count => x_msg_count
100: ,p_data => x_msg_data );
101:
99: fnd_msg_pub.count_and_get( p_count => x_msg_count
100: ,p_data => x_msg_data );
101:
102:
103: WHEN utl_file.invalid_mode then
104: x_return_status := fnd_api.g_ret_sts_error;
105: fnd_msg_pub.count_and_get( p_count => x_msg_count
106: ,p_data => x_msg_data );
107:
117: PROCEDURE disable_file_debug is
118: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
119: BEGIN
120: if (pg_file_name is not null) THEN
121: utl_file.fclose(pg_fp);
122: end if;
123: END disable_file_debug;
124:
125: -- ===========================================