When you have a select * from XXX query, you can get more fields than expected, do you know if there is a way to check if new fields have been added since this request was created and defined its constant fields ?.
You can usually open your queries without worrying about adding new fields. If the new fields are not in your permanent fields, you simply will not see them. But on the DATASnap REST server, you get AV when you try to return a dataset from a query that now has more fields than when creating its constant fields.
If you want to know if there is a quick check, what can I do, I can return a more useful error instead of AV.
Sort of:
MyQuery.Open; if MyQuery.FieldDefs.Count <> MyQuery.Fields.Count then begin raise Exception.Create('The number of returned Fields doesn''t match the expected'); end;
thanks
source share