dgupta70
asked on
utl_file.invalid_path
I am facing problem in executing the package
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 534
ORA-06512: at "SYSTEM.MYDEBUG", line 56
ORA-06512: at "SYSTEM.MYDEBUG", line 66
ORA-06512: at line 3
My package is
============
CREATE OR REPLACE PACKAGE Mydebug AS
-- Define a variable to hold the file id for all debugging actions.
FileId utl_file.file_type;
-- This procedure will initialise the debugging system by opening the debugging file. You
-- could add more stuff here if you wish.
PROCEDURE Initialise(iPath IN VARCHAR2, iFile IN VARCHAR2, iBuffer IN NUMBER := 256);
-- This procedure terminates the debugging system - simply by closing whichever file is open.
-- Although UTL_FILE allows a number of files to be open at any time, this is a simple
-- system and only has a single debugging file.
PROCEDURE TERMINATE;
-- And the guts of the package is this simple procedure to send whatever is passed to it,
-- straight out to the logging file. The option to flush the buffer contents is provided.
PROCEDURE debug_out(iText IN VARCHAR2, iFlush IN BOOLEAN := FALSE);
PROCEDURE Test(File IN VARCHAR2);
END;
/
CREATE OR REPLACE PACKAGE BODY Mydebug AS
-- Define a variable to hold the file id for all debugging actions.
-- FileId utl_file.file_type;
-- This procedure will initialise the debugging system by opening the debugging file. You
-- could add more stuff here if you wish.
PROCEDURE Initialise(iPath IN VARCHAR2, iFile IN VARCHAR2, iBuffer IN NUMBER := 256)
AS
BEGIN
Dbms_Output.put_line('ipat h = '||iPath ||'File '||iFile);
Mydebug.FileId := utl_file.fopen(iPath, iFile, 'W', iBuffer);
Mydebug.debug_out('Debuggi ng session begins at ' || TO_CHAR(SYSDATE));
EXCEPTION
WHEN utl_file.invalid_path THEN
Dbms_Output.put_line('utl_ file.inval id_path');
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.invalid_path');
WHEN utl_file.invalid_mode THEN
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.invalid_mode');
DBMS_OUTPUT.put_line('utl_ file.inval id_mode');
WHEN utl_file.invalid_filehandl e THEN
DBMS_OUTPUT.put_line('utl_ file.inval id_filehan dle');
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.invalid_filehand le');
WHEN utl_file.invalid_operation THEN
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.invalid_operatio n');
DBMS_OUTPUT.put_line('utl_ file.inval id_operati on');
WHEN utl_file.read_error THEN
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.read_error');
DBMS_OUTPUT.put_line('utl_ file.read_ error');
WHEN utl_file.write_error THEN
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.write_error');
DBMS_OUTPUT.put_line('utl_ file.write _error');
WHEN utl_file.internal_error THEN
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.internal_error') ;
DBMS_OUTPUT.put_line('utl_ file.inter nal_error' );
WHEN OTHERS THEN
--RAISE_APPLICATION_ERROR( -20001, 'utl_file.other_error');
DBMS_OUTPUT.put_line('utl_ file.other _error');
END;
-- This procedure terminates the debugging system - simply by closing whichever file is open.
-- Although UTL_FILE allows a number of files to be open at any time, this is a simple
-- system and only has a single debugging file.
PROCEDURE TERMINATE
AS
BEGIN
Mydebug.debug_out('Debuggi ng session terminated at ' || TO_CHAR(SYSDATE));
utl_file.fclose(Mydebug.Fi leId);
END;
-- And the guts of the package is this simple procedure to send whatever is passed to it,
-- straight out to the logging file. The option to flush the buffer contents is provided.
PROCEDURE debug_out(iText IN VARCHAR2, iFlush IN BOOLEAN := FALSE)
AS
BEGIN
utl_file.put_line(Mydebug. FileId, iText);
IF (iFlush) THEN
utl_file.fflush(Mydebug.Fi leId);
END IF;
END;
PROCEDURE Test(File IN VARCHAR2)
AS
BEGIN
Mydebug.INITIALISE('e:\Tru eUpData\', File);
FOR something IN 1..100 LOOP
Mydebug.DEBUG_OUT('Current ly processing record : ' || TO_CHAR(something));
END LOOP;
Mydebug.TERMINATE;
END;
END;
/
My test file is
=========
declare
-- Local variables here
i integer;
begin
Mydebug.Test('test.log');
end;
My package is pretty simple.
I have the directory and i have the permissions.
I am on Win2000 server.
Can anyone help me with this.
Thanks
Deepak
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 534
ORA-06512: at "SYSTEM.MYDEBUG", line 56
ORA-06512: at "SYSTEM.MYDEBUG", line 66
ORA-06512: at line 3
My package is
============
CREATE OR REPLACE PACKAGE Mydebug AS
-- Define a variable to hold the file id for all debugging actions.
FileId utl_file.file_type;
-- This procedure will initialise the debugging system by opening the debugging file. You
-- could add more stuff here if you wish.
PROCEDURE Initialise(iPath IN VARCHAR2, iFile IN VARCHAR2, iBuffer IN NUMBER := 256);
-- This procedure terminates the debugging system - simply by closing whichever file is open.
-- Although UTL_FILE allows a number of files to be open at any time, this is a simple
-- system and only has a single debugging file.
PROCEDURE TERMINATE;
-- And the guts of the package is this simple procedure to send whatever is passed to it,
-- straight out to the logging file. The option to flush the buffer contents is provided.
PROCEDURE debug_out(iText IN VARCHAR2, iFlush IN BOOLEAN := FALSE);
PROCEDURE Test(File IN VARCHAR2);
END;
/
CREATE OR REPLACE PACKAGE BODY Mydebug AS
-- Define a variable to hold the file id for all debugging actions.
-- FileId utl_file.file_type;
-- This procedure will initialise the debugging system by opening the debugging file. You
-- could add more stuff here if you wish.
PROCEDURE Initialise(iPath IN VARCHAR2, iFile IN VARCHAR2, iBuffer IN NUMBER := 256)
AS
BEGIN
Dbms_Output.put_line('ipat
Mydebug.FileId := utl_file.fopen(iPath, iFile, 'W', iBuffer);
Mydebug.debug_out('Debuggi
EXCEPTION
WHEN utl_file.invalid_path THEN
Dbms_Output.put_line('utl_
--RAISE_APPLICATION_ERROR(
WHEN utl_file.invalid_mode THEN
--RAISE_APPLICATION_ERROR(
DBMS_OUTPUT.put_line('utl_
WHEN utl_file.invalid_filehandl
DBMS_OUTPUT.put_line('utl_
--RAISE_APPLICATION_ERROR(
WHEN utl_file.invalid_operation
--RAISE_APPLICATION_ERROR(
DBMS_OUTPUT.put_line('utl_
WHEN utl_file.read_error THEN
--RAISE_APPLICATION_ERROR(
DBMS_OUTPUT.put_line('utl_
WHEN utl_file.write_error THEN
--RAISE_APPLICATION_ERROR(
DBMS_OUTPUT.put_line('utl_
WHEN utl_file.internal_error THEN
--RAISE_APPLICATION_ERROR(
DBMS_OUTPUT.put_line('utl_
WHEN OTHERS THEN
--RAISE_APPLICATION_ERROR(
DBMS_OUTPUT.put_line('utl_
END;
-- This procedure terminates the debugging system - simply by closing whichever file is open.
-- Although UTL_FILE allows a number of files to be open at any time, this is a simple
-- system and only has a single debugging file.
PROCEDURE TERMINATE
AS
BEGIN
Mydebug.debug_out('Debuggi
utl_file.fclose(Mydebug.Fi
END;
-- And the guts of the package is this simple procedure to send whatever is passed to it,
-- straight out to the logging file. The option to flush the buffer contents is provided.
PROCEDURE debug_out(iText IN VARCHAR2, iFlush IN BOOLEAN := FALSE)
AS
BEGIN
utl_file.put_line(Mydebug.
IF (iFlush) THEN
utl_file.fflush(Mydebug.Fi
END IF;
END;
PROCEDURE Test(File IN VARCHAR2)
AS
BEGIN
Mydebug.INITIALISE('e:\Tru
FOR something IN 1..100 LOOP
Mydebug.DEBUG_OUT('Current
END LOOP;
Mydebug.TERMINATE;
END;
END;
/
My test file is
=========
declare
-- Local variables here
i integer;
begin
Mydebug.Test('test.log');
end;
My package is pretty simple.
I have the directory and i have the permissions.
I am on Win2000 server.
Can anyone help me with this.
Thanks
Deepak
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.