id := Connection.NewDataset(sql) as IDAServerDataset;
I use this method to get custom sql datatset. However, some sql is contain special character that violate the sql syntax. Is there any way to make sql safe or can I use parameter way like parambyname to do it?
id := Connection.NewDataset('select * from table where field1 = :p') as IDAServerDataset;
id.ParamByName('p').Value := some_value;
id.Open;
id := Connection.NewDataset('select * from table where {WHERE}') as IDAServerDataset;
id.DynamicWhere.Expression := id.DynamicWhere.NewBinaryExpression('table','field1',some_value);
id.Open;