[DB-SIG] Q: API clarification: display_size, internal_size, precision, scale

M.-A. Lemburg mal@lemburg.com
Fri, 02 Feb 2001 10:34:43 +0100

"Dittmar, Daniel" wrote:
> Could someone explain more clearly what the diffences are between the
> various sizes as required by Cursor.description.
> display_size: I guess this is the maximal number of characters a translation
> to string would require, so a fixed point number with 3 digits before and
> two digits after the decimal point would have a display_size of 6 (3 + 2 + 1
> char for the point)
> internal_size: probably, a UNICODE (10) would give a display_size of 10 and
> an internal_size of 20. What is the intended use? Some databases have a
> limitation on the record size or key size, so internal_size could be used to
> calculate this.
> precision: the number of digits?
> scale: the number of digits after the decimal point?

All of these are standard terms in SQL. display_size and internal_size
really don't have much of a meaning nowadays (they came from the
old days of having to generate reports using line printers).

I'd suggest reading the ODBC docs for details on the others. They
sometimes have weird meanings depending on the column type.

Marc-Andre Lemburg
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/