4 Replies Latest reply: Jan 21, 2013 10:11 PM by 949572 RSS

    Sql loader with oracle forms 10g

    949572
      hello,
      i am working on oracle forms 10.1.2.02 on windows 7 32 bit and oracle database 10g.
      i am trying to transfetr excel data in oracle database table.
      When i am tryng to run sqlldr from cmd(Running as Administrator) ,data successfully transfered.
      But when i try to perform this task via Oracle Forms I am getting

      SQL*Loader-704: Internal error: ulconnect: OCIEnvCreate [-1]

      Error.

      ORACLE_HOME IS PROPERLY SET.


      v_ctl_file := text_io.FOPEN(v_live_path||'test.ctl', 'w');
      text_io.PUT_LINE (v_ctl_file, 'LOAD DATA');
      text_io.PUT_LINE (v_ctl_file, 'INFILE '''||:load.file||'''');
      text_io.PUT_LINE (v_ctl_file, 'BADFILE '''||v_live_path||'bad_data.bad'||'''');
      text_io.PUT_LINE (v_ctl_file, 'INTO TABLE rap_data');
      text_io.PUT_LINE (v_ctl_file, 'fields terminated by "," optionally enclosed by ''"'' trailing nullcols ');
      text_io.PUT_LINE (v_ctl_file, '(
      sno filler ,
      packetid filler ,
      cert filler ,
      shape filler ,
      color "trim(:color)" ,
      clarity "trim(:clarity)" ,
      carats filler ,
      from1 filler ,
      to1 filler ,
      cut "trim(:cut)" ,
      polish "trim(:polish)" ,
      sym "trim(:sym)" ,     
      flr filler ,
      rap filler ,
      back "trim(:back)",
      price filler ,
      tint filler ,
      blkinc filler ,
      loc filler ,
      openinc filler ,
      days filler ,
      backdiff "trim(:backdiff)",
      seller "trim(:seller)" ,
      country "trim(:country)",
      shape1 "trim(:shape1)" ,
      size1 "trim(:size1)",
      color1 "trim(:color1)",
      clarity1 "trim(:clarity1)",
      cut1 "trim(:cut1)",
      polish1 "trim(:polish1)",
      sym1 "trim(:sym1)",
      flour "trim(:flour)",
      price1 "trim(:price1)" ,
      rap1 "trim(replace(:rap1,''%''))" ,
      total "trim(:total)" ,
      lab "trim(:lab)" ,
      depth "trim(:depth)" ,
      table1 "trim(:table1)" ,
      measurements "trim(:measurements)" ,
      position filler,
      packetid1 filler,
      srno recnum)') ;
      text_io.FCLOSE(v_ctl_file);
      v_bat_file := text_io.FOPEN(v_live_path||'load_data.bat', 'w');
      text_io.put_line(v_bat_file,'SET ORACLE_HOME=C:\oracle\product\10.2.0\db_1');
      text_io.put_line(v_bat_file,'SET path=%ORACLE_HOME%\BIN;%PATH%');
      text_io.PUT_LINE (v_bat_file, 'sqlldr userid = '|| usid || '/' ||pwd || '@' ||db || ' ERRORS=1000000 control = '|| v_live_path||'test.ctl log = '|| v_live_path||'test.log'|| ' Skip=1' );
      text_io.FCLOSE (v_bat_file);
      host(v_live_path||'load_data.bat');

      Why this error occured..


      Thanks.