Subject | Re: [IBO] AsTime not implemented? |
---|---|
Author | Helen Borrie |
Post date | 2003-02-19T23:25:51Z |
At 10:35 PM 19/02/2003 +0000, you wrote:
the year, month and day positions. If you are passing a date literal, your
encoding algorithm will need to do this, so that you come out with a date
literal in the correct format, viz.
'00.00.00 hh:nn:ss'
Note that, on the database side, you have to use CAST with date literals in
ODS 10 and higher databases.
On the Delphi side, use AsDateTime.
You can avoid the client-side encoding altogether, by including a server
casting on the actual converted DateTime.
For example,
insert into aTable (TimeRecorded)
values (cast (:Indate) as time))
If what you really want to do is user the server time for the timestamp, it
is even simpler:
insert into aTable(TimeRecorded)
values (CURRENT_TIME)
Helen
>Hello,In Dialect 3 time values are stored as timestamps, with zeros placeholding
>
> I have the statement below which I would like to use, however,
>AsTime is not implemented for the TIB_Column.
>
> sSQL->Params->Columns[0]->AsTime = EncodeTime(ihr,imin,isec,0);
>
> So how are time values stored into TIME param fields?
the year, month and day positions. If you are passing a date literal, your
encoding algorithm will need to do this, so that you come out with a date
literal in the correct format, viz.
'00.00.00 hh:nn:ss'
Note that, on the database side, you have to use CAST with date literals in
ODS 10 and higher databases.
On the Delphi side, use AsDateTime.
You can avoid the client-side encoding altogether, by including a server
casting on the actual converted DateTime.
For example,
insert into aTable (TimeRecorded)
values (cast (:Indate) as time))
If what you really want to do is user the server time for the timestamp, it
is even simpler:
insert into aTable(TimeRecorded)
values (CURRENT_TIME)
Helen