Code: Select all
var
QIbc : TIBCQuery;
Param : TParam;
begin
QIBC := TIBCQuery.Create(nil);
QIbc.FetchAll := True;
QIBC.UniDirectional := False;
try
QIbc.Connection := Self.IBCConnection;
QIbc.SQL.Add('Select * from MODELQUERY543875505 ');
QIbc.SQL.Add('where timestamp = :testParam');
Param := QIbc.FindParam('testParam');
if Assigned(Param) then begin
Param.DataType := ftTimeStamp;
Param.Value := now;
end;
QIbc.Open;
When I do this I get an assertionFailed exception with this message: 'Unknown data type'
I have tried with other time formats; ftDate, ftTime, ftDateTime. These yield an SQL error:
Dynamic SQL Error
SQL error code =-104
Token unknown - line 2, column 17
='.
With the following SQL:
Code: Select all
Select * from MODELQUERY543875505 '#$D#$A'where timestamp = ?I am running IBDAC 5.1.4. for RAD studio XE.
So, How do I use the timestamp format in the IBCQuery?
Bjarke_Moholt
Posts: 13
Joined: Thu 21 Nov 2013 13:51