🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.database.win32
3 messages
3 total messages Started by Ed Thu, 10 Jan 2008 02:33
field size
#141
Author: Ed
Date: Thu, 10 Jan 2008 02:33
24 lines
1465 bytes
Hi,

I understand that TTable.items[x].size contains the size of
the field; but this depends entirely on what the DataType is.

Is there a way to find out the actual 'length' of the field?

If the table itself has the following definition:

MyTable.db:

fldname     character   20
fldindex    numeric     10  0
fldate      date         0  0
flblob      memo         0

How does one go about in finding the above?

For datatype = float,  the precision and size = 0.
For datetypes          the precision and size = 0

Any help appreciated

Edmund
Re: field size
#142
Author: Zoren Lendry
Date: Thu, 10 Jan 2008 03:00
25 lines
2274 bytes
Ed wrote:
> Is there a way to find out the actual 'length' of the field?
> How does one go about in finding the above?
> For datatype = float,  the precision and size = 0.
> For datetypes          the precision and size = 0

Are you asking about how much space a given data type takes in the 
underlying db? If so, then it depends on the database you are using. For 
instance, InterBase and Firebird have 3 separate datatypes for dates and 
times: Timestamp, which occupies 8 bytes, has both a date and a time 
portion. The Date portion is the Integer part, and the Time portion is 
the Float (fraction) part. A Date by itself takes 4 bytes, and contains 
no time information. A Time by itself takes 4 bytes, and contains no 
date information. A Double probably takes 8 bytes. A Boolean takes 2 
bytes. Numeric/Decimal up to a precision of 9 occupies 4 bytes, 8 bytes 
beyond 9.

As far as the TField descendants are concerned, you will get size and 
precision of 0 where the values are irrelevant. For instance, for an 
exact numeric type (NUMERIC/DECIMAL in IB/FB), the precision and scale 
matter a great deal. But for a Double? It just is what it is, up to the max.

You need to say what DB you're using, because it makes a difference.

Loren sZendre
Re: field size
#179
Author: Ed
Date: Fri, 11 Apr 2008 09:56
15 lines
1463 bytes
Zoren Lendry wrote:
> 
> As far as the TField descendants are concerned, you will get size and 
> precision of 0 where the values are irrelevant. For instance, for an 
> exact numeric type (NUMERIC/DECIMAL in IB/FB), the precision and scale 
> matter a great deal. But for a Double? It just is what it is, up to the 
> max.
> 
> You need to say what DB you're using, because it makes a difference.
> 
Hi Zoren,

I'm talking about tables from a FoxPro Database.

Edmund
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads