SELECT
RECID
FROM TABLE
WHERE ((:DX = '''') OR (DX=:DX))
AND ((:POSTCODE='''') OR (POSTCODE=:POSTCODE))
Note, that I am using each named parameter twice in the statement.
When I prepare it in a TUIBQuery I get ParamCount=2 and two parameters
named DX. When I trace the code I see TSQLParams.Parse passing over the
my SQL and calling AddFieldA four times. I can see that duplicates are
recognized and added to the end of FXSQLDA, but FParamCount is not
incremented.
As a temporary dumb fix I have added such an increment and I now get
(DX, DX, POSTCODE, POSTCODE) as parameter-list. That sort of works.
Question: Is the sort of parameter-reuse I am attempting supported by
Firebird? By UIB? Is my fix viable?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to run the Query
Note, that I am using each named parameter twice in the statement.
When I prepare it in a TUIBQuery I get ParamCount=2 and two parameters
named DX. When I trace the code I see TSQLParams.Parse passing over the
my SQL and calling AddFieldA four times. I can see that duplicates are
recognized and added to the end of FXSQLDA, but FParamCount is not
incremented.
As a temporary dumb fix I have added such an increment and I now get
(DX, DX, POSTCODE, POSTCODE) as parameter-list. That sort of works.
Question: Is the sort of parameter-reuse I am attempting supported by
Firebird? By UIB? Is my fix viable?
this ghost house is abandoned long ago
try https://github.com/hgourvest/uib/commits/master