Subject | Re: [IBO] Date/Time string conversion utility function? |
---|---|
Author | Thomas Steinmaurer |
Post date | 2015-12-09T07:05:29Z |
Hello Helen,
While this has worked so far with dialect 3 databases, as the redo process supports (using proper TFormatSettings in Delphi) the date/time format from an implicit date/time to VARCHAR cast in the log trigger, this obviously fails with dialect 1 due to a different date/time format used there in case of an implicit CAST.
Thanks.
--
With regards,
Thomas Steinmaurer
http://www.upscene.com
Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.
> Hello Thomas,Unfortunately, I cannot use this in that scenario. It is in the IBLogManager context, where a VARCHAR field is some sort of container for all non-BLOB data storing OLD/NEW values, which later on gets processed to re-apply changes on a destination database.
>
> Wednesday, December 9, 2015, 1:55:39 AM, you wrote:
>
>> I have to deal with date/time information in a database implicitly
>> casted and stored in a VARCHAR field, thus depending on the database
>> dialect, I end up with something like that. For example:
>
>> Dialect 1: 7-DEC-2015 20:29:12.3820
>> Dialect 3: 2015-12-07 20:31:07.2280
>
>> I have to process that strings as TDateTime in an IBO based Delphi
>> application later on, independent of the local regional settings the
>> Delphi application is running on.
>
>> Does IBO have some sort of utility function supporting various "native"
>> date/time string representations of InterBase/Firebird, where the result
>> is of type TDateTime?
>
> Is there some reason why you can't bring the string into the dataset
> as a timestamp directly in a run-time field, using a short cast?
> e.g.
> select ....,
> timestamp (TheStringField) as aTimestamp,
> ...
While this has worked so far with dialect 3 databases, as the redo process supports (using proper TFormatSettings in Delphi) the date/time format from an implicit date/time to VARCHAR cast in the log trigger, this obviously fails with dialect 1 due to a different date/time format used there in case of an implicit CAST.
Thanks.
--
With regards,
Thomas Steinmaurer
http://www.upscene.com
Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.
> Firebird (and, AFAIR, IB) accepts a huge variety of date/time strings
> as valid, including the two examples here.
>
> Helen
>
>
>
> ------------------------------------
> Posted by: Helen Borrie <helebor@...>
> ------------------------------------
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> http://tracker.ibobjects.com - your portal to submit and monitor bug reports
> http://community.ibobjects.com - your portal to purchase and upgrade
> ------------------------------------
>
> Yahoo Groups Links
>
>
>