Prepare - The data types nvarchar and sql_variant are incompatible in the add operator.
Posted: Mon 22 Sep 2014 09:49
Hello!
We're using odac in Delphi for years and we're now extending our software to use sdac 6.10.21 and odac 9.3.10 at the same time. The following code raises an Error in sdac, when executing the prepare.
When we put the '%' into the parameter instead of the sql-statement, it works fine. In the forum we've read about defining the parameters datatype before preparing. Is there any other solution for our problem? In odac this code sequences works perfect (with || instead of +).
Yours sincerely
Andreas
We're using odac in Delphi for years and we're now extending our software to use sdac 6.10.21 and odac 9.3.10 at the same time. The following code raises an Error in sdac, when executing the prepare.
Code: Select all
qry: TMSQuery;
...
qry.SQL.Text := 'SELECT name FROM sys.objects WHERE name = :sName And type_desc LIKE ''%'' + :sTyp + ''%''';
qry.Prepare;
...
Yours sincerely
Andreas