Clarity

 View Only
  • 1.  XOG Out Contents of Custom Object

    Posted Apr 05, 2018 09:51 AM

    I'm trying to use XOG to export the contents of a custom object that I manually created (and populated) to XML.  I probably have something wrong in the <Filter> tag.  I remarked out the instanceCode section because (and I hate to admit this), I have no idea what it is, so I was hoping it's optional.  Since I'm getting an SQL 936 error, it's probably not optional ...

     

    The Object ID in the object's Properties page is charge_code_parents, so I'm assuming that's what I should be using for the objectCode filter value.  That might be wrong, too.

     

    So, my questions are:

     

    1) Where can I find the instanceCode value to include in the filter, and;

    2) Is charge_code_parents the right objectCode value for this exercise?

     

    Or I am going about this in the totally wrong way?  Any advice would be much appreciated.

     

    The XOG code is:

     

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="14.2.0.237" action="read" objectType="customObjectInstance" externalSource="NIKU"/>
    <CustomObjectInstanceQuery>
    <Filter name="objectCode" criteria="EQUALS">charge_code_parents</Filter>
    <!--<Filter name="instanceCode" criteria="EQUALS">FTK00000835</Filter>-->
    </CustomObjectInstanceQuery>
    </NikuDataBus>

     

    The result is:

     

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
    <Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="15.3.0.200" />
    <customObjectInstances objectCode="charge_code_parents"></customObjectInstances>
    <XOGOutput>
    <Object type="customObjectInstances" />
    <Status state="FAILURE" />
    <Statistics insertedRecords="0" failureRecords="0" totalNumberOfRecords="0" updatedRecords="0" />
    <Records>
    <Record>
    <KeyInformation>
    <column name="objectCode">charge_code_parents</column>
    <column name="instanceCode" />
    </KeyInformation>
    <ErrorInformation>
    <Severity>FATAL</Severity>
    <Description>Custom Object Instance Export Failed</Description>
    <Exception><![CDATA[SQL Exception with error code : 936]]></Exception>
    </ErrorInformation>
    </Record>
    </Records>
    </XOGOutput>
    </NikuDataBus>



  • 2.  Re: XOG Out Contents of Custom Object
    Best Answer

    Posted Apr 05, 2018 10:09 AM

    Yes the "objectCode" is the ObjectID on the object properties page in the studio screens

    The instanceCode should just be the code attribute on the instance ; i.e. odf_ca_charge_code_parents.code

     

    If you omit the instanceCode filter though you should be able to read out all instances of your custom object - but that seems to be what is generating the odd 936 "error" for you (have you tried removing the line rather than just 'commenting' it out?).

     

     



  • 3.  Re: XOG Out Contents of Custom Object

    Posted Apr 05, 2018 10:54 AM

    Agree with Dave_3.0 . For one explanation of 936 error in Oracle see

    ORA-00936: missing expression tips 



  • 4.  Re: XOG Out Contents of Custom Object

    Posted Apr 05, 2018 11:08 AM

    ^ yeah that might be the database engine just getting 'confused' with that commented out line?



  • 5.  Re: XOG Out Contents of Custom Object

    Posted Apr 05, 2018 11:12 AM

    Hi David,

     

    Thanks for that feedback.  Based on your response, I tried this:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="8.0" action="read" objectType="customObjectInstance" externalSource="NIKU"/>
    <CustomObjectInstanceQuery>
    <Filter name="objectCode" criteria="EQUALS">charge_code_parents</Filter>
    <Filter name="instanceCode" criteria="OR">odf_ca_charge_code_parents.code</Filter>
    </CustomObjectInstanceQuery>
    </NikuDataBus>

     

    And the result was this:

     

    -<NikuDataBus xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <Header version="15.3.0.200" objectType="customObjectInstance" externalSource="NIKU" action="write"/>

    <customObjectInstances objectCode="charge_code_parents"/>


    -<XOGOutput>

    <Object type="customObjectInstances"/>

    <Status state="SUCCESS"/>

    <Statistics updatedRecords="0" totalNumberOfRecords="0" failureRecords="0" insertedRecords="0"/>

    <Records/>

    </XOGOutput>

    </NikuDataBus>

     

    Even though there are 9 records in that table, so I was expecting 9 "rows" of output.  Could it be case-sensitivity in the value I provided (odf_ca_charge_code_parents.code) for instanceCode?

     

    (NOTE: I had to include instanceCode in the filter to avoid the SQL 936 error.  If I remarked out that row, or deleted it entirely, I got the SQL 936 error.)

     

    Getting closer, at least ...



  • 6.  Re: XOG Out Contents of Custom Object

    Posted Apr 05, 2018 11:20 AM

    OK I did't mean;

    <Filter name="instanceCode" criteria="OR">odf_ca_charge_code_parents.code</Filter>

     

    I meant

    <Filter name="instanceCode" criteria="OR">the value of the database table odf_ca_charge_code_parents and column code field</Filter>

     

     

    But you should also be able to see that value in the application, its just the 'code' attribute on the instance.

     

    --

     

    Strange that removing the line entirely gives you an error though, didn't expect that ; starting to suspect "odd data" might be the issue



  • 7.  Re: XOG Out Contents of Custom Object

    Posted Apr 05, 2018 11:24 AM

    Yep, I finally figured that out.  The line below caused it to export all 9 records.  Thanks again for your help!

     

    <Filter name="instanceCode" criteria="EQUALS">*</Filter>

     

    The good ol' asterisk saved me, once I stopped being so literal!



  • 8.  Re: XOG Out Contents of Custom Object

    Posted Apr 05, 2018 11:55 AM

    Another thing is that is OR with one code only going to work?