Subject RE: [IBO] Problem with parameters in query
Author Jason Wharton

 

 


From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Wednesday, August 30, 2017 5:13 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Problem with parameters in query

 




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.



This is a really urgent issue, so could you please help me with that?

 

Regards

Helmut