hi,
I'm new in ibdac components. I'm not able to set parameters for a sql statement.
Below an example:
ibcQuery1.sql.Text:='select * from mytable';
ibcupdatesql1.InsertSQL := 'insert into mytable (field1, field2) values (:par1, :par2)';
How to set par1 and par2 ? I mean something like this :
ibcupdatesql1.SQL[ukInsert].parambyname('par1').asstring := 'valore';
Thanks in advance for any help.
Use ibcupdate component to insert/update a lot of records
TUniUpdateSQL does not allow using parameters of SQL properties. In order to get access to those parameters you should use the Object properties like InsertObject, UpdateObject, and DeleteObject. You can assign the TUniSQL component to these properties to perform advanced adjustment of the insert/update/delete operations.
Also note: SQLInsert statement can be parameterized queries. If the names of the parameters are the same as those of fields, then values from fields will be set in parameters automatically. Parameters prefixed with OLD_ allow using current values of fields prior to an actual operation.
Also note: SQLInsert statement can be parameterized queries. If the names of the parameters are the same as those of fields, then values from fields will be set in parameters automatically. Parameters prefixed with OLD_ allow using current values of fields prior to an actual operation.
Also, you can handle the TCustomDADataSet.BeforeUpdateExecute event and set parameters value, like this:
Code: Select all
Params.ParamByName(ParamName).AsString := s;