Querying linked tables using SQL

Charles Yeomans charles at declareSub.com
Sat Mar 31 15:08:26 CDT 2007


On Mar 31, 2007, at 4:56 PM, Ruslan Zasukhin wrote:

> On 31/3/07 8:35 PM, "Charles Yeomans" <charles at declareSub.com> wrote:
>
> Hi Charles,
>
>> The following query used to work for me, but stopped doing so
>> sometime around V4Rb 2.5.
>>
>> SELECT Decisions.recID FROM Decisions JOIN Law ON LawDecision WHERE
>> Decisions.is_deleted=false AND (Law.recID=36)
>>
>> Here, LawDecision is a M-M link between the tables Law and Decision.
>>
>> VStudio shows linked records as they should be, at least for a local
>> database;
>
> You mean in data browser?

Yes.

>
>> as usual, the same thing for a remote database does not
>> work.  So I don't think that it is a database corruption issue --
>> any other suggestions?
>
> I have not catch.
>
> 1) so query works LOCALLY ?
>
> 2) and not works on vserver?
>     I doubt. Because this is the same engine AND SQL.

Sorry.  If I open a local copy of the database, then the data browser  
shows the correct linked fields.  If I open a remote copy of the  
database, the data browser shows the same number of linked records,  
but it shows the data for the first record in each row.

Executing the query above shows all records, not just the linked  
records.



>
> 3) LawDecision is BinaryLink, right?

Yes.

Charles Yeomans


More information about the Valentina mailing list