Related Record Count Syntax Please

Chuck Pelto cbpelto at pcisys.net
Sat Dec 18 14:15:30 CST 2004


Hi Peter,

Is there any way to do this WITHOUT going to an SQL search?

There IS the call for RecordCount in the reference manual. Is there a 
way to use BaseObject pointers and achieve this?

Regards,

Chuck


On Dec 18, 2004, at 2:10 PM, Peter De Berdt wrote:

>
> On 18 Dec 2004, at 21:48, Chuck Pelto wrote:
>
>> What is the sequence of calls and the syntax thereof for getting the 
>> number of related records found in a child data file?
>>
>> I see RecordCount but in every example used in the reference, it only 
>> describes the data in the BaseObject. Not any related BaseOjbect.
>>
> As soon as you query the related BaseObject, the database will return 
> the "related records"
>
> Example
>
> SELECT * FROM MasterTable, RelatedTable WHERE ...
>
> Will return the related records, together with all the fields from the 
> master table (which will be the same in all the records)
>
> Alternatively, you could use
>
> SELECT Count(*) FROM MasterTable, RelatedTable WHERE ...
>
> Then you can take the ULongValue from the first field and you'll have 
> the number of records.
>
> Ruslan will be able to tell you which one of the two is the most 
> performant (in a multi-user environment, you'd better use a server 
> side cursor in the first option).
>
> Best regards
>
> Peter De Berdt
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list