Subject | Problem with parameters in query |
---|---|
Author | |
Post date | 2017-08-30T11:13:27Z |
Hello Jason,
since I updated from IBO4.8 to IBO5.9 I had some issues. Most of them are already fixed, but today I discovered a new one.
I have a TIB_Query with a SQL Statment that has parameters.
Example:
Query .SQL.Text := 'select * from table1 where :par1 = '''' or table1.field1 = :par1';
If field1 is any kind of varchar or a date, it raises an exception "Invalid parameters with duplicate names".
That did not happen in the old IBO.
It works, if I cast the parameter like:
Query .SQL.Text := 'select * from table1 where cast (:par1 as varchar (30)) = '''' or table1.field1 = cast (:par1 as varchar (30))';
It also works, if I cast the field like:
Query .SQL.Text := 'select * from table1 where :par1 = '''' or cast (table1.field1 as varchar (30)) = :par1';
The problem ist, that my applicaiton is several hundreds of thousends lines of source code and there is no way, I can look through all of them to find such queries.