MxLoader

 View Only
  • 1.  Query Subordinate (Child) Tables

    Posted 10-28-2021 08:54
    Hi All,

    Is it possible to configure MxLoader to query subordinate (child) tables? For example, I want to query the ASSET object but I also want to query the ASSETSPEC at the same time.

    assetnum = '12345' and assetspec.assetattrid = 'manufacturer'

    Thanks

    Stevie

    ------------------------------
    Stevie Holloway
    Tufts University
    ------------------------------


  • 2.  RE: Query Subordinate (Child) Tables

    Posted 10-28-2021 09:25

    Are you using the REST based approach or the default OS (which uses the SOAP API)? You can see that on the Config tab. It changes how the data is retrieved which is why I'm asking.

    Also, are you trying to just return the specific spec mentioned (in this case MANUFACTURER) or the assets that have that specification? If it's the latter and you're using the OS (SOAP), when you provide the query (in the D1 column) it's executing a SQL query. So for your example, to query the assetspec you would want to add something like this to your query:

    exists(SELECT 1 FROM assetspec WHERE asset.assetnum=assetspec.assetnum and asset.siteid=assetspec.siteid and assetspec.assetattrid='MANUFACTURER')


    If you're using the REST based approach, you need to use the oslc.where format which would look like this:

    assetspec.assetattrid="MANUFACTURER"

    Both of those would return all assets (and all their specs) if it has that specification. With the REST API it's possible to apply a filter on the child object (to reduce the data displayed to just the spec you want for example) but I'm not sure if that works with MXLoader today. 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: Query Subordinate (Child) Tables

    Posted 10-28-2021 13:13
    Thank you so much for your help.

    Stevie

    ------------------------------
    Stevie Holloway
    Tufts University
    ------------------------------



  • 4.  RE: Query Subordinate (Child) Tables

    Posted 01-29-2024 08:04

    Hey Steven!

     As I read through it post, this seems to be the exact problem I'm facing. I have a child table which I want to filter but since I'm using oslc.where=relationship.attributename="value" , I'm not able to get the filtered values in my response, instead I'm getting all values under the parent table.

    Can we still achieve it through some way, I want to apply a filter on the child object to reduce the data displayed to just the spec I want to filter?

    Any inputs on this will be really helpful.

    Thanks,

    Tanmay



    ------------------------------
    N S Tanmay De
    Infosys
    ------------------------------