Jump to content
Sign in to follow this  

FireDAC - TFDQuery - How to default calculated fields in the dataset to ReadOnly=False

Recommended Posts

I'm using the FireDAC TFDQuery component to run a SQL SELECT statement against a SQL Server database. The SQL statement contains a few 'calculated' column expressions using SQL functions such as CONVERT and CAST.  For example : CONVERT(DECIMAL(9, 6), 0) AS TotalHours   and   CONVERT(TINYINT, 0) AS WorkflowState.


In the resulting dataset, these calculated TField objects are always set to ReadOnly=True. I want to populate these calculated fields in code after the dataset has been returned.  I know I can do this by changing the ReadOnly property of each field :

Dataset.FieldByName('MyCalcField').ReadOnly := False;

But is there a setting/option within the query components that I can use to force the fields created to always default to ReadOnly=False?

Edited by JonathanW

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this