Page 1 of 1

subquery as fieldname

Posted: Thu 22 Jan 2009 12:15
by jkuiper
I use this query in Delphi

Code: Select all

SELECT inkoopregels.*
  (SELECT SUM(aantal_bollen) FROM ontvangsten
    WHERE ontvangsten.inkoopregelnummer = inkoopregels.inkoopregelnummer) AS ontvangenbollen
FROM inkoopregels
Will the field "ontvangenbollen" be seen as a readonly field. For now I put the the fieldvalue into a integer variable to work with it. And I'm not really sure if MyDAC is asking to put that field in editmode to change it.

Posted: Fri 23 Jan 2009 08:58
by Dimon
This field is an aggregated field and it can not be edited. But its ReadOnly property is set to False by default.
To set ReadOnly to True you should set the TMyQuery.Options.SetFieldsReadOnly property to True.