5 Replies Latest reply: Apr 23, 2012 7:21 AM by Catch-22 RSS

    utl_file gives error when coping file from windows to linux

    ZARdba
      Red Hat Enterprise Linux Server release 5.7 (Tikanga)
      Oracle 11.1

      Hi there,

      I can't copy a file with utl_file.fcopy after copying file with samba from winodws to linux. Only after I open the file on linux and save it, can I copy it :

      1.) Copy file from windows (drag and drop)
      2.)
      SQL> exec utl_file.fcopy('XXMS_DATA_IMPORTS', 'Project_62.csv','XXMS_DATA_IMPORTS', 'xxms_pa_tasks_master.csv');
      BEGIN utl_file.fcopy('XXMS_DATA_IMPORTS', 'Project_62.csv','XXMS_DATA_IMPORTS', 'xxms_pa_tasks_master.csv'); END;

      ***
      ERROR at line 1:
      ORA-29284: file read error
      ORA-06512: at "SYS.UTL_FILE", line 270
      ORA-06512: at "SYS.UTL_FILE", line 1243
      ORA-06512: at line 1

      3.)su to root
      4.)open file and save it with vi, without changing anything
      5.)
      SQL> exec utl_file.fcopy('XXMS_DATA_IMPORTS', 'Project_62.csv','XXMS_DATA_IMPORTS', 'xxms_pa_tasks_master.csv');

      PL/SQL procedure successfully completed.

      How can I copy from windows to linux with samba, so this doesn't happen?
      Please help