Page 1 of 1

Prepare Erroring under sql server - execsql does not

Posted: Mon 03 Oct 2011 20:27
by tonymeadors
The PREPARE method below works for IB and Oracle 10g
but gives an elaborate Error message under sql server 2005.


q.sql.add('update pr_master set check_date= :checkdate');
q.ParamByName('checkdate').assqltimestamp := datetimetosqltimestamp(now);
q.Prepare; ///
q.execsql;


The Error text includes:
EMSError with message 'Statement(s)' could not be prepared.
Implicit conversion from data type sql_variant to datetime is not allowed.
Use the CONVERT function to run this query.


The field check_date is defined on the sql server as DATETIME.

NOTE: if I remove the q.prepare; line the q.execsql does
work properly for sql server.

Am I missing something here - quite possible.

Thanks for your incredible help and responsiveness
to all those on this forum "watch." Quite impressive.

Sincerely,
tonyM

Posted: Wed 05 Oct 2011 13:05
by AndreyZ
We have reproduced the problem and the investigation of the problem is in progress. We will notify you when we have any results.

Posted: Fri 21 Oct 2011 12:26
by Dimon
We have fixed this problem. This fix will be included in the next UniDAC build.