# SOQL passed via DBAmp to Salesforce using openquery does not return all rows.

**URL:** <https://community.cdata.com/t/soql-passed-via-dbamp-to-salesforce-using-openquery-does-not-return-all-rows/981>\
**Category:** CData DBAmp\
**Tags:** openquery, question, soql, dbamp\
**Created:** [December 28, 2024, 12:25am UTC](https://community.cdata.com/t/soql-passed-via-dbamp-to-salesforce-using-openquery-does-not-return-all-rows/981 "2024-12-28T00:25:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HRMiller](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@HRMiller](https://community.cdata.com/u/HRMiller)\
**Post date:** [December 28, 2024, 12:25am UTC](https://community.cdata.com/t/soql-passed-via-dbamp-to-salesforce-using-openquery-does-not-return-all-rows/981/1 "2024-12-28T00:25:27Z")

</div>

soql passed through&nbsp;dbamp to salesforce using openquery syntax selects from Contact and includes select from child table.&nbsp; &nbsp;&nbsp;See query below.

For the ID specified in the query there are 13 records in the child table which match that ID.&nbsp; Only 2 records are returned.

Would like to know why.&nbsp; Is this a DBAmp bug?&nbsp; I did just install the latest DBAmp version.&nbsp; 22.0.8991.0

Any other possible explanation?

SELECT \* FROM &nbsp;OPENQUERY(SALESFORCE, ’ &nbsp;SELECT ID, Email, CLSA\_Date\_Completed\_\_c, Client\_Identifies\_Race\_\_c, Latino\_Hispanic\_\_c, ExpECM\_\_Race\_\_c, Religious\_Spiritual\_Affiliation\_\_c,&nbsp;  
ExpECM\_\_Preferred\_Language\_\_c, Secondary\_Language\_Spoken\_\_c, SACWIS\_Case\_ID\_\_c, SACWIS\_Person\_ID\_\_c, Primary\_Insurance\_Company\_HMO\_\_c, &nbsp;npe01\_\_HomeEmail\_\_c,Preferred\_Method\_of\_Contact\_\_c,  
Primary\_Policy\_including\_MA\_\_c,&nbsp;  
Primary\_Phone\_\_c, Primary\_Phone\_is\_Mobile\_\_c, Secondary\_Phone\_\_c, Secondary\_Phone\_is\_Mobile\_\_c  
, (SELECT ExpECM\_\_Main\_Client\_\_c, Name FROM ExpECM\_\_Case\_Records\_\_r)  
FROM Contact  
WHERE ID = ‘‘0031U00001MH3tSQAT’’  
')
