title: How to insert into Table in Oracle 10g from Text file using PLSQL program?
body: <p>I'm trying this PL/SQL program in Oracle 10g. To Read text file (data) from loaction 'C:\Oracle' and load it into Oracle Table using PLSQL script. But, I'm getting the following errors:</p>
  
  <pre><code>ORA-29283: invalid file operation
  ORA-06512: at "SYS.UTL_FILE", line 488
  ORA-29283: invalid file operation
  </code></pre>
  
  <p><strong>Here's my Script:</strong></p>
  
  <pre><code>Create or Replace PROCEDURE Rfile is
      line VARCHAR2(100);
      namesfile UTL_FILE.FILE_TYPE;
  BEGIN
      --  Syntax : FOPEN ( directory alias, filename, open mode)
  
      namesfile  := UTL_FILE.FOPEN('FILESDIR1','NAMES2.TXT','R'); -- open in read mode 
  
      LOOP
        UTL_FILE.GET_LINE(namesfile,line,100);
        dbms_output.put_line(line);
  
        insert into names2 values(line);                  -- insert into NAMES table
      END LOOP;
  EXCEPTION
      WHEN OTHERS THEN
      dbms_output.put_line('Others exceptions....');
  END;
  </code></pre>