2. TFDQuery & an TFDUpdateSQL assigned as the update object.
3. TFDUpdateSQL.InsertSql executes a stored procedure to perform insert, which affects a number of tables.
4. TFDUpdateSQL.InsertSql stored procedure returns an ID field value, which is the key field in TFDQuery. Ex: UserId.
5. UserId is an AutoInc TField in the TFDQuery.
What is the proper way to push the value returned by the stored procedure into the AutoInc field on an inserted record? Previous methods I used are not working.
TFDUpdateSQL, Stored Procedure - Setting field value from output variable
in Databases
Posted
Given:
1. Database is MSSQL
2. TFDQuery & an TFDUpdateSQL assigned as the update object.
3. TFDUpdateSQL.InsertSql executes a stored procedure to perform insert, which affects a number of tables.
4. TFDUpdateSQL.InsertSql stored procedure returns an ID field value, which is the key field in TFDQuery. Ex: UserId.
5. UserId is an AutoInc TField in the TFDQuery.
What is the proper way to push the value returned by the stored procedure into the AutoInc field on an inserted record? Previous methods I used are not working.
Here is some code that does NOT work: