4 Replies Latest reply on May 18, 2018 9:42 PM by ksdesh

    loadData in JAVA API


      I am playing around with the Essbase Java API. I am trying to load data to the Essbase cube using the loadData method. It's an overloaded method, I am trying the one where you can load data using an "update specification as a single string"



      void loadData(boolean store, boolean unlock, java.lang.String updSpec) throws com.essbase.api.base.EssException 
      Updates data to cube from the specification string.
      store - Controls storage of data. If true data is stored in the server; if false no data is stored.
      unlock - Controls unlocking of data blocks. If true all relevant blocks which are locked will be unlocked (after data is stored, if necessary). If false no blocks are unlocked.
      updSpec - The update specification as a single string.
      com.essbase.api.base.EssException - if an error occurs.


      What is the update spec? Is it just a CSV string with all the dim members specifying the intersection followed by the data? I can't find a use example anywhere. If someone can point me to a good starting point I would really appreciate it. Thanks.

        • 1. Re: loadData in JAVA API

          I have used that.

          ksdesh wrote:

          What is the update spec? Is it just a CSV string with all the dim members specifying the intersection followed by the data?

          Yes. Just all dimension members followed by data. Here is an example one with rulefile to load data.


          public static void loadASO(String ruleFile,IEssCube cube, String InputFileName ){


                        try {

                               logger.debug("Importing "+InputFileName+"...");

                               cube.loadData(IEssOlapFileObject.TYPE_RULES, ruleFile, IEssOlapFileObject.TYPE_TEXT,InputFileName , true, null,null);

                        /*     cube.asyncLoadData(IEssOlapFileObject.TYPE_RULES, ruleFile, IEssOlapFileObject.TYPE_TEXT,InputFileName , true, null,null);



                               logger.debug("Completed import of "+InputFileName+"...");

                        } catch (EssException e) {

                               logger.error("Error: loadASO Failed " + e.getMessage());





          • 2. Re: loadData in JAVA API

            So it is not a comma separated value string. I tried with CSV and this is what I got :

            <type 'com.essbase.api.base.EssException'>, com.essbase.api.base.EssException: Cannot update. Essbase Error(1003014): Unknown Member [*My Entire String was here*] in Data Load, [0] Records Completed, <traceback object at 0x3>


            I changed to a tab delimited string an it seems to have worked. I get this error now:


            <type 'com.essbase.api.base.EssException'>, com.essbase.api.base.EssException: Cannot update. Essbase Error(1014004): Unable to Update Members Which Have Not Been Locked, <traceback object at 0x3>


            So it seems like now it understands what members I am passing. Anyone know what I need to do before the push to lock the cells? I can't find any lock calls in the API documentation.

            • 3. Re: loadData in JAVA API

              If you have a look at the JAPI samples in <MIDDLEWARE_HOME>\EPMSystem11R1\common\EssbaseJavaAPI\\samples\japi

              There is LoadData.java which has examples of loading data and a method for loading a string of data.






              1 person found this helpful
              • 4. Re: loadData in JAVA API

                Thanks!! There is a huge treasure trove of examples in that folder and  I had no idea that it was there.


                I had the 'unlock' parameter set to True, from the documentation it seemed like if I had it set to false, it would load data and keep the cells locked. I changed it to False and the load ran without errors.