Queries were nice until I ran into this. I've got a
query that pulls the accountid, name, zip, and the
parentaccountid fields from the accounts data.

Get this - it REPLACES my parentaccountid field with
something called "result_Id" and it's 1-x based on the
row value.

This is driving me nuts. How on earth can I return the
parentaccountid? It's more than likely due to a foreign
key issue, but...

Here's the exact query:

<fetch mapping='logical'>
<entity name='account'>
<attribute name = 'accountid'/>
<attribute name = 'name'/>
<attribute name = 'address1_postalcode'/>
<attribute name = 'parentaccountid'/>
<filter type='or'>
<condition attribute='name'
operator='eq' value='xxx'/>
<condition attribute='name'
operator='like' value='xxx%'/>
<condition attribute='name'
operator='like' value='%xxx'/>
<condition attribute='name'
operator='like' value='xxx %'/>
<condition attribute='name'
operator='like' value='% xxx'/>
</filter>
</entity>
</fetch>

Any help would be appreciated since I'm now STUCK...

Big problems with a Query - help! by David

David
Wed Jun 23 14:25:10 CDT 2004

Well, what happened is that the XML returned from the
query was including multiple fields in the FK_field
reference, so it created a second table with the
references that I had to manually pick out and propogate.

Would be nice to know if that can be turned off or not
(the additional field info for fields that are a FK
reference).

>-----Original Message-----
>Queries were nice until I ran into this. I've got a
>query that pulls the accountid, name, zip, and the
>parentaccountid fields from the accounts data.
>
>Get this - it REPLACES my parentaccountid field with
>something called "result_Id" and it's 1-x based on the
>row value.
>
>This is driving me nuts. How on earth can I return the
>parentaccountid? It's more than likely due to a foreign
>key issue, but...
>
>Here's the exact query:
>
><fetch mapping='logical'>
> <entity name='account'>
> <attribute name = 'accountid'/>
> <attribute name = 'name'/>
> <attribute name = 'address1_postalcode'/>
> <attribute name = 'parentaccountid'/>
> <filter type='or'>
> <condition attribute='name'
>operator='eq' value='xxx'/>
> <condition attribute='name'
>operator='like' value='xxx%'/>
> <condition attribute='name'
>operator='like' value='%xxx'/>
> <condition attribute='name'
>operator='like' value='xxx %'/>
> <condition attribute='name'
>operator='like' value='% xxx'/>
> </filter>
> </entity>
></fetch>
>
>Any help would be appreciated since I'm now STUCK...
>
>.
>