Can UNIX ORACLE 10G use UTL_FILE package to read file data?
I use UTL_FILE to read the data of the text file under WINDOW, I will test it, but I don't do it in Unix Oracle! Error! Begin LoadFileData ('D: / ORA', '1.txt'); end; ora-29280: Directory path invalid ORA-06512: in "sys.utl_file", line 33ra-06512: in "sys.utl_file", LINE 436RA-06512: In "Wty.loadFileData", Line 20ORA-06512: in line 1 ==================== My stored procedure is loadFileData: Create or Replace procedure loadfiledata (p_path varchar2, p_filename varchar2) isv_filehandle utl_file.file_type; - define a file handle v_text varchar2 (100); - storing text v_name test.name% type; v_id test.autoid% type; v_firstlocation number; v_secondlocation number; v_totalinserted number; beginif (p_path is null or p_filename is null) thengoto to_end; end if; v_totalinserted: = 0; / * open specified file * / v_filehandle: = utl_file.fopen (p_path, p_filename, 'r'); --- - Open the file, read the data loopbeginutl_file.get_line (v_filehandle, v_text); ExceptionWhen No_data_found thenexit; end; v_firstlocation: = IXSTR (v_text, ',', 1, 1); --- Text file first ',' location V_ID : = Substr (v_text, 1, v_firstlocation-1); --- Intercepting the first "of the text file ',' prior string. v_name: = substr (v_text, v_firstlocation 1); / * insert database operation * / begininsert into testvalues (v_id, v_name); if sql% rowcount = 0 thenrollback; elsecommit; end if; exceptionwhen others thenrollback; end; end loop; << TO_END >> UTL_FILE.FCLOSE (V_FILEHANDLE); NULL; End LoadFileData; =========== LoadFileData stored procedure running normal in Window Oralce 8i, but why is Unix Oracle 1OG, is it in UNIX? Oracle 1OG changes to the UTL_FILE package! Everyone helps! My personal website http://www.kao99.com