TimeStamp data types from xharbour
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
TimeStamp data types from xharbour
Hi.
Lately I've been wanting to use some "new" data types offered by ADT tables. A classical example is a field of data type "timestamp". But I find that this data type is not available from xharbour.
How can I write to a timestamp, double, short, etc... data type field of an ADT table from xharbour?
Any ideas?
Reinaldo.
Lately I've been wanting to use some "new" data types offered by ADT tables. A classical example is a field of data type "timestamp". But I find that this data type is not available from xharbour.
How can I write to a timestamp, double, short, etc... data type field of an ADT table from xharbour?
Any ideas?
Reinaldo.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Antonio,
from ADS help file
saludos
Marcelo
from ADS help file
and, I have interest in MONEY type too, but I get error when I try to assign some value to this field type8-byte value where the high order 4 bytes are an integer containing a Julian date, and the low order 4 bytes are internally stored as the number of milliseconds since midnight. If using the Advantage CA-Visual Objects RDDs, this is a string type.
Obviously this is [x]Harbour issue (ADSRDD), but maybe some body in the forum have some solutionCurrency data stored internally as a 64-bit integer, with 4 implied decimal digits from -922,337,203,685,477.5807 to +922,337,203,685,477.5807. The Money data type will not lose precision.
saludos
Marcelo
Antonio Linares wrote:Reinaldo,
Whats the size in bytes and the contents of a timestamp field in ADT ?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Antonio,
I tryed, but a get ADSADT/1020 Data type error on the assign command, maybe we need to move the question to the [x]Harbor develop team
gracias
Marcelo
I tryed, but a get ADSADT/1020 Data type error on the assign command, maybe we need to move the question to the [x]Harbor develop team
gracias
Marcelo
Antonio Linares wrote:Marcelo,
Please try this and lets see if the ADS RDD allows it:
test->tstamp := L2Bin( 0 ) + L2Bin( 0 )
MsgInfo( test->tstamp )
where tstamp is a timestamp field
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Time stamp fields work well with xHarbour without any extra efforts.
When we read a timestamp field into a memory variable it is a datetime value. And we can straight away assign a datetime value to a timestamp field. For creating an adt table through dbcreate, use 'T' as the field type.
No special effort is needed on our part.
When we read a timestamp field into a memory variable it is a datetime value. And we can straight away assign a datetime value to a timestamp field. For creating an adt table through dbcreate, use 'T' as the field type.
No special effort is needed on our part.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
In the above example, we can simply say :
Code: Select all
test->tstamp := datetime() // or any other datetime variable
// for testing, check
msginfo( ttoc( test->tstamp ) )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Mr Marcelo
You simply assign and retrieve numerical values to and from these fields also as usual.
You are mentioning about the precision of Money fields. When we ask the server to do the totals and sums of large number this precision helps. We never get rounding errors. For exaample 'SELECT SUM(FIELDMONEY) FROM SALESTABLE' ...
You simply assign and retrieve numerical values to and from these fields also as usual.
You are mentioning about the precision of Money fields. When we ask the server to do the totals and sums of large number this precision helps. We never get rounding errors. For exaample 'SELECT SUM(FIELDMONEY) FROM SALESTABLE' ...
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India