in-list parameter as array (etc)
Posted: Thu 09 Jan 2020 06:08
I've been thinking that something like this would make code way easier.
SELECT *
FROM TABLEA
WHERE
ID IN (:INPARAMETER)
could use it like
LQueryTableA.ParamByName('INPARAMETER').InParameter([1, 2, 3, 4, 5]);
(not .AsInArray etc because can't overload because values can come from different data types)
It should have few overloads depending where data is coming From. TStrings, TArray<T>, TList<T> at least.
Should take care of quotes and so. This would make code side way simpler and no need for own code to handle all this. Not sure which databases support this natively somehow, if not, could just modify SQL I think.
-Tee-
SELECT *
FROM TABLEA
WHERE
ID IN (:INPARAMETER)
could use it like
LQueryTableA.ParamByName('INPARAMETER').InParameter([1, 2, 3, 4, 5]);
(not .AsInArray etc because can't overload because values can come from different data types)
It should have few overloads depending where data is coming From. TStrings, TArray<T>, TList<T> at least.
Should take care of quotes and so. This would make code side way simpler and no need for own code to handle all this. Not sure which databases support this natively somehow, if not, could just modify SQL I think.
-Tee-