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
Prepare Erroring under sql server - execsql does not
-
tonymeadors
- Posts: 35
- Joined: Wed 28 Feb 2007 17:56
-
AndreyZ