Expand my Community achievements bar.

SOLVED

SOAP call Response sort based on linked table field

Avatar

Level 2

I have a requirement to sort based on a field from a linked table in the output of a soap call(wsdl). I am using queryDef ExecuteQuery method.

 

This field is available in Table C. Table C is linked to Table B and Table B is linked to Table A. We are using Table A to query in Soap call.

We are able to order with the field available in Table A but how to order the results based on the field available in Table C.

 

Please let me know if you any idea. Thank you in advance.

 

Regards,

Uday Sakhre

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

Use <orderBy/> on the field, e.g.:

<orderBy>
  <node expr="[tableA/tableB/tableC/@sortField]"/>
</orderBy>

 

The tables will have to have their relations already defined in schema def.

 

Thanks,

-Jon

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

Use <orderBy/> on the field, e.g.:

<orderBy>
  <node expr="[tableA/tableB/tableC/@sortField]"/>
</orderBy>

 

The tables will have to have their relations already defined in schema def.

 

Thanks,

-Jon

Avatar

Level 2

Thanks Jon for the update. But with this approach, getting PostgreSQL error: column s0.sortField does not exist.

This approach will work if the link is defined in Table A.

But here

Link is defined in table C to link table B.

Link is defined in table B to link table A. And

No link defined in Table A.

 

Thanks,

Uday

Avatar

Community Advisor
In the definitions also specify the reverse link, i.e. revLink, will work fine. Replace @sortField here with the col you want to sort by.