Multiple param entries in SQL statement causes AV
Hello, developers of TIBCustomDataSet (and relative)!
Somehow, when SQL statement contains more than one entry of an parameter,
using this parameter's value like
DataSet.QSelect.Params.ByName( 'c_year' ).Value := xx
causes AV at procedure IBSQL.TIBXSQLVAR.SetIsNull(Value: Boolean),
because xvar.FXSQLVAR^.sqlind is nil for i>0.
(using IBXDP5EBETAUP41, IBSQL.pas, line 1259).
The same, if assigning DataSet.Params.ByName().Value.
My current workaround is assigning "processed" SQL statements with
parameters set "statically"
(like << SelectSQL.Text := Format( 'SELECT * FROM xxx WHERE l_year=%d',
cur_year ] ) >> ),
which of course will not work fast if placed in a detail TIBDataSet.
BTW, the way DataSet.Params works is not very useful, IMHO. (As I see it is
the same as QSelect.Params? )
These parameters should be global for the whole this TIBCustomDataSet,
affecting QSelect,
QInsert, QModify and QDelete statements, because it is needed
to assign each QSelect.Params.ByName( 'par_name' ).Value,
QModify.Params......, QDelete.Params..., etc.
I wonder, if multiple parameter entries are not so often encountered by
others?
VB