The latest 4.50 releases (0.34 and 0.35) as well as 4.35 have a defect using DefaultExpression to populate data fields on Append. If TMSQuery fields have a default expression and you execute the method Append, you immediately get an error "Invalid Field 'False', Invalid Field P...". For some reason, the component is trying to do a “SELECT False, False, P, 0, True” statement during the append statement with all the default values of any fields that have one.
Any one else experience this issue?
SDAC 4.50 DefaultExpression error
You should quote default expression values if you do not want them to be requested from the server. For example, 'True' instead of True, 'P' instead of P, etc. But there is no need to quote numbers.
In the next build of SDAC we are planning to add recognizing unquoted True/False values in DefaultExpression.
In the next build of SDAC we are planning to add recognizing unquoted True/False values in DefaultExpression.
That's not the behavior of 4.10 and previous. When I set the DefaultExpression value of a string field to a quoted value such as 'P', the quotes are getting added to the data field. If I quote a boolean field with 'False' or 'True', I get an error that 'False' is not a valid boolean value for field 'IsCompany'. Is SDAC now fetching default values from the server to pre-populate in an Append? I currently don't have default values at the server and this will be quite an extensive change to upgrade if this is now normal behavior. What version did this change take place?
Ok, I re-upgraded to 4.50.0.35 and see how DefaultExpression is now used. This behavior now makes SDAC different than standard DataSet components in the way DefaultExpression values are handled. It also makes another round trip to SQL Server for an append. I can see some nice capability in using a feature like this, but if it were me, I would have made it an alternate property or possibly an option. I will have to change thousands of values to be compliant with this new change which makes this a breaking upgrade. Is there any way to disable this method of fetch? I must now change every instance of boolean defaults (True and False) to 1 and 0 as these are the SQL values.