Updating a Calculated field in Stored Procedure

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 28
Joined: Wed 18 Jan 2012 20:15

Updating a Calculated field in Stored Procedure

Post by GNiessen » Tue 17 Jul 2012 22:15

I have a TMSStoredProcedure that get a set of records. Included in it is an integer value "Age" and date "DateOfBirth". I do an internal calc for the New age and update the records before displaying them.

I only want to update records if another change is made to the records (Age is readonly). So set the field type to ftCalculated. Which worked in that I could edit the value without triggering an Update.

I am doing the updates with another Stored procedure that is called in the UpdateSQL, which includes :Age as a parameter. But I am getting an error: "Not found field corresponding parameter Age." during the Post. Yet, I have a field defined for it and obviously have the column. How can I include this value in the updates?


Re: Updating a Calculated field in Stored Procedure

Post by AndreyZ » Wed 18 Jul 2012 10:02


Please specify the following:
- the script to create your stored procedures (the one that selects data and the other that updates it);
- the script to create tables that are used by your stored procedures.
Also, I will be able to give you a prompt answer faster if you create a small sample that demonstrates this problem and send it to andreyz*devart*com , including the scripts I mentioned above.

Post Reply