Results 1 to 3 of 3

Thread: Sys.utl_file

  1. #1
    Join Date
    Aug 2005
    Posts
    19

    Red face Unanswered: Sys.utl_file

    hi..

    i'm using oracle 9.x , i'm develop a code for to insert the records from excel sheet,After When I run the follwing code it will return the error
    ORA-06512: at line 7

    declare
    fhandle utl_file.file_type;

    fbuffer varchar2(4096);
    begin

    fhandle := utl_file.fopen (' C:\Documents and Settings\venkat\Desktop', '$30 new list.csv', 'r');
    while true loop
    utl_file.get_line (fhandle, fbuffer);
    insert into temp_sqlldr(MEM_ID, MEM_FNAME)
    select (substr(fbuffer,1,instr(fbuffer,','))),
    to_number(substr(fbuffer,instr(fbuffer,',')+1))
    from dual;
    end loop;
    end;

    Errors :
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SYS.UTL_FILE", line 120
    ORA-06512: at "SYS.UTL_FILE", line 204
    ORA-06512: at line 7


    What could be the reason. Pls clarify with some small example how this error is comming and how to eliminate.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >What could be the reason(sic ?)
    UTL_FILE can only operatate against directories/files which are local to the server, that have appropriate permissions, and that have been enabled via initSID.ora parameter.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Sep 2005
    Posts
    4
    In addition, the use of UTL_FILE_DIR is advised against on security grounds. The advice now is to create a directory and use that instead.

Posting Permissions

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