1 Reply Latest reply: Nov 12, 2012 3:03 AM by JeromeFr RSS

    Error in loading the multiple file loading

    AMSI
      hi,
      i am following this blog to load the multiple files into rdbms table.
      http://www.odigurus.com/2011/05/multiple-files-single-target-table.html

      the problem is that when i assign the source Flat file Datastore
      Model Resource Name #Project_Name.FILE_NAME
      But when i point the Single File in the  Resource Name:EMP.DMP. its working fine. loaded suceessfully.... But problem in Multiple loading???

      it gives me error

      SQL*Loader-500: Unable to open file (E:/File/#Project_Name.FILE_NAME)
      SQL*Loader-553: file not found
      SQL*Loader-509: System error: The system cannot find the file specified.
      SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.

      ********************Task Error Code In Loading**********************************************
      import java.lang.String
      import java.lang.Runtime as Runtime
      from jarray import array
      import java.io.File
      import os
      import re


      ctlfile = r"""E:/File/Med_CDR_File.ctl"""
      logfile = r"""E:/File/Med_CDR_File.log"""
      outfile = r"""E:/File/Med_CDR_File.out"""
      oracle_sid=''
      if len('')>0: oracle_sid = '@'+''


      loadcmd = r"""sqlldr 'test/<@=snpRef.getInfo("DEST_PASS") @>%s' control='%s' log='%s' > "%s" """ % (oracle_sid,ctlfile, logfile, outfile)


      rc = os.system(loadcmd)

      if rc <> 0 and rc <> 2:
           raise "Load Error", "See %s for details" % logfile

      # Init Vars
      nbIns = 0
      nbRej = 0
      nbNull = 0
      strprt = ""
      maxAllowedError = r"""0"""
      c = 0
      flag = 0

      # Open log file
      f = open(logfile, "r")
      try:
           lines = f.readlines()
           for line in lines:
                if line.rstrip().upper().endswith(r"""TEST.TC$_0MSC_SMS:""".upper()):
                     flag = 1
                     c = 0
                if flag == 1:
                     if c > 0 and c <= 4:
                          if c == 1 :
                               nbIns = int(re.findall("\d+", line)[0])
                          elif c == 2:
                               nbRej = int(re.findall("\d+", line)[0])
                          elif c == 4:
                               nbNull = int(re.findall("\d+", line)[0])
                               break
                c+=1
           strprt = "\n\tIns:\t%s\n\tReject:\t%s\n\tNullField:\t%s" % (nbIns, nbRej, nbNull)
      finally:
           f.close()


      # if some rows has been rejected due to invalide data, check KM option LOA_ERRORS
      if rc == 2:
           if nbRej > int(maxAllowedError):
                raise strprt
                break

      *************************************************************************



      waiting

      Regards,

      Edited by: AMSI on Nov 10, 2012 1:40 AM