4 Replies Latest reply on Apr 20, 2017 1:48 PM by Francisco Amores

    Jython update error

    Orv-Oracle

      I want to make a update TDATASEG_T using this jython script. However it fails the source is EBS 11i Oracle, I got the

       

      import java.sql as sql

      import java.lang as lang

      import decimal

       

       

       

      sLocName = fdmContext['LOCNAME']

      if sLocName == "BMB_EBSR11_MEXICO":

       

       

          fdmAPI.logInfo("Custom Script: INICIA TRANSFORMACION ACCOUNT")

        

       

       

          query = "UPDATE TDATASEG_T SET VALID_FLAG = 'I' WHERE ACCOUNT LIKE '7%'"

       

       

       

       

       

          params = [fdmContext['LOADID']]

       

       

          fdmAPI.logInfo("INICIA TRANSFORMACION ACCOUNT HOLA" + str(params))

       

       

          try:

       

       

              fdmAPI.executeDML(query, params, False)

       

       

              fdmAPI.commitTransaction()

       

       

          except sql.SQLException, e:

       

       

              print "Error: Ivan Error SQL: " + str(e)

        • 1. Re: Jython update error
          SH_INT

          What is the error you are getting, that might help with the analysis of what's going wrong. Also which event are you executing this script in? However, straight away I can see from your code that youe are passing the LOADID as a parameter to the query but then not actually referencing that parameter in the UPDATE statement. That could be the casue of your issue (and even if it isn't you will want to rectify that oversight) but like I said we would need to see the generated error to be certain

          1 person found this helpful
          • 2. Re: Jython update error
            Francisco Amores

            Hi Ivan,

             

            in addition to LOADID issue, next time you say it fails, include at least the error :-)

             

            Some comments:

            1) print command won't have any result in your logs

            2) you are trying to set VALID_FLAG to I in TDATASEG_T. In which event script? I say that because this column might be updated when mapping process happens (I did not test but I guess it can happen)

            • 3. Re: Jython update error
              Orv-Oracle

              Hi Francisco yes you are right, sorry I forget to add more information  because the issue was solved by someone else.

              • 4. Re: Jython update error
                Francisco Amores

                Hi,

                 

                please can you close this thread then?

                 

                Cheers