You are not logged in.
https://synopse.info/files/html/Synopse … 01.18.html
...
5.5.2.2.1. Introducing TSQLRecordMany
...
for i := 1 to high(dID) do
begin
Check(MS.DestList.SourceGet(aClient,dID[i],res));
if not Check(length(res)=1) then <<<<<<<<<<<<<<<<<<<<<<<<<<< should be CheckFailed as shown in SynSelfTests.pas
Check(res[0]=sID[i]);
Check(MS.DestList.ManySelect(aClient,sID[i],dID[i]));
Check(MS.DestList.AssociationTime=i);
end;
for i := 1 to high(sID) do
begin
Check(MS.DestList.DestGet(aClient,sID[i],res));
if Check(length(res)=1) then <<<<<<<<<<<<<<<<<<<<<<<<<<< should be CheckFailed as shown in SynSelfTests.pas
continue; // avoid GPF
Check(res[0]=dID[i]);
Offline
Another typo
/// retrieve all records associated to a particular Dest record, which
// has a TSQLRecordMany property
// - returns the Count of records corresponding to this aSource record <<<<<<<<<<<<<<<<<<<<<<< "this aSource record" should be "this aDest record" ?
// - use a "for .." loop or a "while FillOne do ..." loop to iterate
// through all Dest items, getting also any additional 'through' columns <<<<<<<<<<<<<<<<<<<<<<< "through all Dest items" should be "through all Source items" ?
// - the optional aAndWhereSQL parameter can be used to add any additional
// condition to the WHERE statement (e.g. 'Salary>:(1000): AND Salary<:(2000):')
// according to TSQLRecordMany properties - note that you should better use
// inlined parameters for faster processing on server, so you may call e.g.
// ! aRec.FillManyFromDest(Client,DestID,FormatUTF8('Salary>? AND Salary<?',[],[1000,2000]));
function FillManyFromDest(aClient: TSQLRest; aDestID: TID;
const aAndWhereSQL: RawUTF8=''): integer;
Moreover, would you also include test for FillManyFromDest in SynSelfTests.pas ?
Offline