DBA Data[Home] [Help]

APPS.HR_TKPROF_PLUS dependencies on UTL_FILE

Line 9: g_log_file UTL_FILE.file_type; -- log file handle

5: -- define global log variables
6: g_log_file_extention CONSTANT VARCHAR2(4) := '.cbo'; -- log file extension
7: g_script_file_extention CONSTANT VARCHAR2(4) := '.sql'; -- script file extension
8: g_log_level PLS_INTEGER; -- log level
9: g_log_file UTL_FILE.file_type; -- log file handle
10: g_log_filename VARCHAR2(120); -- log filename
11: g_script_filename VARCHAR2(120); -- script filename
12: g_filename VARCHAR2(120); -- tkprof filename
13: g_script_file UTL_FILE.file_type; -- script file handle

Line 13: g_script_file UTL_FILE.file_type; -- script file handle

9: g_log_file UTL_FILE.file_type; -- log file handle
10: g_log_filename VARCHAR2(120); -- log filename
11: g_script_filename VARCHAR2(120); -- script filename
12: g_filename VARCHAR2(120); -- tkprof filename
13: g_script_file UTL_FILE.file_type; -- script file handle
14: g_log_line_separator CONSTANT VARCHAR2(80) := LPAD('-',78,'-');
15: -- define global table structures
16: g_table_counter BINARY_INTEGER;
17: g_backup_stats VARCHAR2(1);

Line 47: ,p_file IN UTL_FILE.file_type DEFAULT g_log_file) IS

43: -- correct level
44: -- ---------------------------------------------------------------------------------------
45: PROCEDURE write_log(p_text IN VARCHAR2 DEFAULT NULL
46: ,p_level IN PLS_INTEGER DEFAULT 1
47: ,p_file IN UTL_FILE.file_type DEFAULT g_log_file) IS
48: BEGIN
49: IF g_log_level > 0 AND p_level <= g_log_level THEN
50: IF p_text IS NULL THEN
51: -- output new line

Line 52: UTL_FILE.new_line(file => p_file, lines => 1);

48: BEGIN
49: IF g_log_level > 0 AND p_level <= g_log_level THEN
50: IF p_text IS NULL THEN
51: -- output new line
52: UTL_FILE.new_line(file => p_file, lines => 1);
53: ELSE
54: -- output the log line
55: UTL_FILE.put_line(file => p_file, buffer => p_text);
56: END IF;

Line 55: UTL_FILE.put_line(file => p_file, buffer => p_text);

51: -- output new line
52: UTL_FILE.new_line(file => p_file, lines => 1);
53: ELSE
54: -- output the log line
55: UTL_FILE.put_line(file => p_file, buffer => p_text);
56: END IF;
57: END IF;
58: EXCEPTION
59: WHEN OTHERS THEN

Line 262: p_file IN UTL_FILE.file_type)

258: -- description:
259: -- gets a line from the file
260: -- ---------------------------------------------------------------------------------------
261: FUNCTION get_line(
262: p_file IN UTL_FILE.file_type)
263: RETURN VARCHAR2 IS
264: l_buffer VARCHAR2(32767);
265: BEGIN
266: -- get a line from the file

Line 267: UTL_FILE.get_line(file => p_file, buffer => l_buffer);

263: RETURN VARCHAR2 IS
264: l_buffer VARCHAR2(32767);
265: BEGIN
266: -- get a line from the file
267: UTL_FILE.get_line(file => p_file, buffer => l_buffer);
268: RETURN (l_buffer);
269: EXCEPTION
270: WHEN OTHERS THEN
271: -- an internal error has occurred

Line 306: p_file IN UTL_FILE.file_type,

302: -- description:
303: -- processes the tkprof file extracting out the SQL stmts.
304: -- ---------------------------------------------------------------------------------------
305: PROCEDURE process_tkprof_file(
306: p_file IN UTL_FILE.file_type,
307: p_limit IN PLS_INTEGER) IS
308: --
309: l_tkprof_line VARCHAR2(32767);
310: l_sql_found BOOLEAN := FALSE;

Line 908: g_log_file := UTL_FILE.fopen

904: IF p_log_level > 0 AND p_log_level <= 2 THEN
905: -- set the log filename
906: g_log_filename := p_filename||g_log_file_extention;
907: -- open the log file for writing
908: g_log_file := UTL_FILE.fopen
909: (location => p_location,
910: filename => g_log_filename,
911: open_mode => 'w',
912: max_linesize => 32767);

Line 918: g_script_file := UTL_FILE.fopen

914: g_log_level := p_log_level;
915: --
916: IF g_script_stats = 'Y' AND p_log_level = 2 THEN
917: g_script_filename := p_filename||g_script_file_extention;
918: g_script_file := UTL_FILE.fopen
919: (location => p_location,
920: filename => g_script_filename,
921: open_mode => 'w',
922: max_linesize => 32767);

Line 933: WHEN UTL_FILE.invalid_path THEN

929: ELSE
930: g_log_level := 0;
931: END IF;
932: EXCEPTION
933: WHEN UTL_FILE.invalid_path THEN
934: g_error_text := 'The LOG location path is invalid';
935: RAISE;
936: WHEN UTL_FILE.invalid_mode THEN
937: g_error_text := 'The LOG file was opened with an invalid mode';

Line 936: WHEN UTL_FILE.invalid_mode THEN

932: EXCEPTION
933: WHEN UTL_FILE.invalid_path THEN
934: g_error_text := 'The LOG location path is invalid';
935: RAISE;
936: WHEN UTL_FILE.invalid_mode THEN
937: g_error_text := 'The LOG file was opened with an invalid mode';
938: RAISE;
939: WHEN UTL_FILE.invalid_operation THEN
940: g_error_text := 'The LOG file was opened with an invalid operation';

Line 939: WHEN UTL_FILE.invalid_operation THEN

935: RAISE;
936: WHEN UTL_FILE.invalid_mode THEN
937: g_error_text := 'The LOG file was opened with an invalid mode';
938: RAISE;
939: WHEN UTL_FILE.invalid_operation THEN
940: g_error_text := 'The LOG file was opened with an invalid operation';
941: RAISE;
942: WHEN OTHERS THEN
943: g_log_level := 0;

Line 956: l_file UTL_FILE.file_type := g_log_file;

952: -- if the log level has been set (e.g. greater than zero) or the log file is open
953: -- flush out the buffer and close the log file.
954: -- ---------------------------------------------------------------------------------------
955: PROCEDURE close_log_file IS
956: l_file UTL_FILE.file_type := g_log_file;
957: BEGIN
958: IF g_log_level > 0 THEN
959: -- write out the log summary
960: show_summary;

Line 962: UTL_FILE.FFLUSH(file => l_file);

958: IF g_log_level > 0 THEN
959: -- write out the log summary
960: show_summary;
961: -- flush the buffer
962: UTL_FILE.FFLUSH(file => l_file);
963: -- close the opened log file
964: UTL_FILE.fclose(file => l_file);
965: IF g_script_stats = 'Y' AND g_log_level = 2 THEN
966: l_file := g_script_file;

Line 964: UTL_FILE.fclose(file => l_file);

960: show_summary;
961: -- flush the buffer
962: UTL_FILE.FFLUSH(file => l_file);
963: -- close the opened log file
964: UTL_FILE.fclose(file => l_file);
965: IF g_script_stats = 'Y' AND g_log_level = 2 THEN
966: l_file := g_script_file;
967: -- flush the buffer
968: UTL_FILE.FFLUSH(file => l_file);

Line 968: UTL_FILE.FFLUSH(file => l_file);

964: UTL_FILE.fclose(file => l_file);
965: IF g_script_stats = 'Y' AND g_log_level = 2 THEN
966: l_file := g_script_file;
967: -- flush the buffer
968: UTL_FILE.FFLUSH(file => l_file);
969: -- close the opened script file
970: UTL_FILE.fclose(file => l_file);
971: END IF;
972: END IF;

Line 970: UTL_FILE.fclose(file => l_file);

966: l_file := g_script_file;
967: -- flush the buffer
968: UTL_FILE.FFLUSH(file => l_file);
969: -- close the opened script file
970: UTL_FILE.fclose(file => l_file);
971: END IF;
972: END IF;
973: EXCEPTION
974: WHEN OTHERS THEN

Line 989: RETURN UTL_FILE.file_type IS

985: -- ---------------------------------------------------------------------------------------
986: FUNCTION open_tkprof_file(
987: p_location IN VARCHAR2,
988: p_filename IN VARCHAR2)
989: RETURN UTL_FILE.file_type IS
990: --
991: l_location_null EXCEPTION;
992: l_filename_null EXCEPTION;
993: --

Line 1003: UTL_FILE.fopen(

999: END IF;
1000: -- open the tkprof file for reading and return the file type
1001: -- handle
1002: RETURN (
1003: UTL_FILE.fopen(
1004: location => p_location,
1005: filename => p_filename,
1006: open_mode => 'r',
1007: max_linesize => 32767));

Line 1015: WHEN UTL_FILE.invalid_path THEN

1011: RAISE;
1012: WHEN l_filename_null THEN
1013: g_error_text := 'The TKPROF filename is required and cannot be NULL';
1014: RAISE;
1015: WHEN UTL_FILE.invalid_path THEN
1016: g_error_text := 'The TKPROF location path is invalid';
1017: RAISE;
1018: WHEN UTL_FILE.invalid_mode THEN
1019: g_error_text := 'The TKPROF file was opened with an invalid mode';

Line 1018: WHEN UTL_FILE.invalid_mode THEN

1014: RAISE;
1015: WHEN UTL_FILE.invalid_path THEN
1016: g_error_text := 'The TKPROF location path is invalid';
1017: RAISE;
1018: WHEN UTL_FILE.invalid_mode THEN
1019: g_error_text := 'The TKPROF file was opened with an invalid mode';
1020: RAISE;
1021: WHEN UTL_FILE.invalid_operation THEN
1022: g_error_text := 'The TKRPOF file was opened with an invalid operation';

Line 1021: WHEN UTL_FILE.invalid_operation THEN

1017: RAISE;
1018: WHEN UTL_FILE.invalid_mode THEN
1019: g_error_text := 'The TKPROF file was opened with an invalid mode';
1020: RAISE;
1021: WHEN UTL_FILE.invalid_operation THEN
1022: g_error_text := 'The TKRPOF file was opened with an invalid operation';
1023: RAISE;
1024: WHEN OTHERS THEN
1025: g_error_text := g_error_std_text||'open_tkprof_file: '||

Line 1036: p_file IN UTL_FILE.file_type) IS

1032: -- description:
1033: -- close the tkprof file
1034: -- ---------------------------------------------------------------------------------------
1035: PROCEDURE close_tkprof_file(
1036: p_file IN UTL_FILE.file_type) IS
1037: l_file UTL_FILE.file_type := p_file;
1038: BEGIN
1039: IF UTL_FILE.IS_OPEN(l_file) THEN
1040: -- close the opened tkprof file

Line 1037: l_file UTL_FILE.file_type := p_file;

1033: -- close the tkprof file
1034: -- ---------------------------------------------------------------------------------------
1035: PROCEDURE close_tkprof_file(
1036: p_file IN UTL_FILE.file_type) IS
1037: l_file UTL_FILE.file_type := p_file;
1038: BEGIN
1039: IF UTL_FILE.IS_OPEN(l_file) THEN
1040: -- close the opened tkprof file
1041: UTL_FILE.fclose(file => l_file);

Line 1039: IF UTL_FILE.IS_OPEN(l_file) THEN

1035: PROCEDURE close_tkprof_file(
1036: p_file IN UTL_FILE.file_type) IS
1037: l_file UTL_FILE.file_type := p_file;
1038: BEGIN
1039: IF UTL_FILE.IS_OPEN(l_file) THEN
1040: -- close the opened tkprof file
1041: UTL_FILE.fclose(file => l_file);
1042: END IF;
1043: EXCEPTION

Line 1041: UTL_FILE.fclose(file => l_file);

1037: l_file UTL_FILE.file_type := p_file;
1038: BEGIN
1039: IF UTL_FILE.IS_OPEN(l_file) THEN
1040: -- close the opened tkprof file
1041: UTL_FILE.fclose(file => l_file);
1042: END IF;
1043: EXCEPTION
1044: WHEN OTHERS THEN
1045: -- an internal error has occurred

Line 1060: l_file UTL_FILE.file_type;

1056: p_limit IN PLS_INTEGER DEFAULT 5,
1057: p_log_level IN PLS_INTEGER DEFAULT 2,
1058: p_explain_table IN VARCHAR2 DEFAULT 'PLAN_TABLE') IS
1059: --
1060: l_file UTL_FILE.file_type;
1061: --
1062: BEGIN
1063: -- initialise the explain sql counters
1064: g_explain_sql_counter := 0;

Line 1114: UTL_FILE.fclose_all;

1110: close_log_file;
1111: EXCEPTION
1112: WHEN OTHERS THEN
1113: -- close all open files
1114: UTL_FILE.fclose_all;
1115: raise_application_error(-20001,g_error_text);
1116: END run;
1117: END hr_tkprof_plus;