× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The original implementation of date\time and timestamp had the database always converting a first time from internal [i.e. integer] form to the external character string when read by the RPG; a full 26-bytes for a TIMESTAMP field, for example. Thus when any function against the date-related field was requested, the strings would have to be converted a second time, into the internal form in order to perform any date arithmetic & comparisons, then those integers would have to be converted a third time into strings when requesting to place the updated values in the database, and finally the database would convert those strings a fourth time to the internal form for the actual record in the database file.

As I understood, that implementation had changed such that the RPG could & would ask the database to return the data in the internal form for those data types, and perform the conversion into the string representation only when requested. Thus those date related data types should work much more like the numeric types with editing, except instead of %edit_ BIFs, using date\time related BIFs. Any calculated or unchanged value in internal form can then be passed back directly to the database in the same internal form, thus avoiding any conversion from string to internal form by the database update or write; just as it was on the read.

Except if made available by UDF to the database, the functions which might\could be used to treat the decimal values as date\time [beyond just presentation to give the appearance that the decimal values are date\time] are not available to the database. Thus to utilize date\time\timestamp in the database without the RPG [e.g. in SQL], define the column\field data with the actual date\time\TS data types to directly enable the various date\time related scalar functions, arithmetic, & comparisons.

Regards, Chuck

George Lopez wrote:
From what I heard from Bob Cozzi years many years ago there is a disadvantage using timestamp field in physical file instead of
the tried and true date and time decimal fields in terms of speed
if you are doing mass update of those fields in an RPG progam?
Or is that not true anymore?


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.