ExecSqlEx Params
Posted: Wed 07 Dec 2016 10:05
After upgrading project from version from ODAC version 6 to 9 i findout that was changed logic of working ExecSqlEx with parameters.
Earlier you can call:
Odac link all params value by name and all works fine. Now - "Array of parameter values arranged in the same order as they appear in SQL statement."(from documentation). So using of this function lose sense, it's same ExecSQL but with ignoring each param[i mod 2 = 0] (from user side).
I check your sources and find out that it's can be easily fixed by simply changing 2 lines of code, from:
to:
But using of manually changed sources it's not a good way of working(for future updates), so question: Can you do this(or you got better solution) changes in your sources?
P.S. Changing of my sources it's very hard task, because it's using as base for uses scripts with thousands lines of code.
Earlier you can call:
Code: Select all
ExecSQLEx( ' begin :result := GetSysFilter(:p_ClassID, :p_UserID); end;',
[ 'p_ClassID', p_ClassID,
'p_UserID', p_UserID
]
);
I check your sources and find out that it's can be easily fixed by simply changing 2 lines of code, from:
Code: Select all
varByte, varWord, varLongWord, varShortInt, varSmallint, varInteger:
FCommand.Params[i].AsInteger := Params[i * 2 + 1];
else
FCommand.Params[i].Value := Params[i * 2 + 1];
Code: Select all
varByte, varWord, varLongWord, varShortInt, varSmallint, varInteger:
FCommand.ParamByName(PName).AsInteger := Params[i * 2 + 1];
else
FCommand.ParamByName(PName).Value := Params[i * 2 + 1];
P.S. Changing of my sources it's very hard task, because it's using as base for uses scripts with thousands lines of code.