subquery as fieldname

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

subquery as fieldname

Post by jkuiper » Thu 22 Jan 2009 12:15

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.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 23 Jan 2009 08:58

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.

Post Reply