Related Record Count Syntax Please

Peter De Berdt peter.de.berdt at pandora.be
Sat Dec 18 22:10:58 CST 2004


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



More information about the Valentina mailing list