Page 1 of 1

Changing from .assqltimestamp to .asdatetime

Posted: Tue 04 Oct 2011 13:13
by tonymeadors
Under Delphi 7 our apps worked equally with Oracle,
SQL Server, IB and Firebird. To do so required filling
datetime parameters thus:

q.parambyname('adate').assqltimestamp:= datetimetosqltimestamp(d);

Because using .asdatetime gave numerous problems in D7.


With unidac under Delphi2010 we have found the opposite.
Using .assqltimestamp does not smoothly work across these
dbtypes at this time.

BUT - returning to .asdatetime seems to work slick as
a whistle.

So we are changing back to assignments throughout:
q.parambyname('adate').asdatetime:= d;

Hope this helps,

tonyM

(to hold our datetimes we use
timestamp in IB and FB
datetime in sql server
date in oracle )

Posted: Wed 05 Oct 2011 13:50
by AndreyZ
Please specify the exact problems that you encountered with the AsSQLTimeStamp property under Delphi 2010, and we will try to help you.

Working well now

Posted: Tue 11 Oct 2011 18:09
by tonymeadors
We are now consistently filling parameters with datetime without
any problems - using xxx.asdatetime:=d;

In an ealier post I suggested that IB was giving an error
when using .assqltimestamp.

from that post:
=================================
With tuniquery, the following gives an error with Interbase:

uniquery.sql.add('update ap_master set check_date=:xdatetime');
uniquery.parambyname('xdatetime').assqltimestamp:= datetimetosqltimestamp(now);

interbase yields:
"EConvertError with message Unknown Datatype"
sql server works
oracle works

=================================

Your staff replied that this was being addressed
and would be found fixed in the next release.

So all is well - both for me now, and for future
uses of assqltimestamp.

Thanks for your great work,
tonyM

Posted: Fri 14 Oct 2011 07:58
by AndreyZ
We have released new builds of all DAC components. You can try them and check if the problem with the AsSQLTimeStamp property is solved.