Add Parameter Arrays to IDBStatement.SetParams

Add and additional method to enable params to passed in as an array of Variant as can be done on FireDac.

This would assign the Param values to Param placeholders in the SQL in the order presented, raising an exception if the type conversion fails. If there are less params than placeholders then an exception is raised; If more, then the values after the last placeholder is filled are ignored.

procedure SetParams(Params: array of Variant); overload;

That can be accomplished by using the existing SetParams, all you need is to pass the TDBParam objects without a specified name (empty). This way, it will set the parameter by the position, not name.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.