Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: Issue in using UTL File Pkg

    Hi, when I executed the following procedure, I am getting the error :

    Error :
    ====

    1
    User-Defined Exception

    Procedure :
    ========

    create or replace procedure utl_proc
    is
    handle UTL_FILE.FILE_TYPE;
    lv_parameter varchar2(2500) := 'This is a sample UTL FILE usage';
    begin
    handle := UTL_FILE.FOPEN('/ora8/test_machine','test.txt','A');
    UTL_FILE.PUT_LINE(handle,lv_parameter);
    UTL_FILE.PUT_LINE(handle,lv_parameter);
    UTL_FILE.FCLOSE(handle);
    EXCEPTION
    WHEN OTHERS THEN
    UTL_FILE.FCLOSE(handle);
    DBMS_OUTPUT.put_line (SQLCODE);
    DBMS_OUTPUT.put_line (SQLERRM);
    end;


    Also the local file is not appended with the text I have given.
    Please advice,

    Thanks,
    Sam

  2. #2
    Join Date
    Mar 2004
    Posts
    205
    I tried with exception handling

    It says that the file location or file name is invalid.

    But my file exists in that path, please advice. Am I missing anything ?

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    UTL_FILE has a bunch of user-defined exceptions that you need to trap - see documentation.

    Quite likely the directory you specified is not accessible to UTL_FILE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •