20 July 2009

Informix: Size ของแต่ละ Data Type

Integer = 4 byte
Date/Timestamp = 4 byte

You can use the following formulas (rounded down to a whole number of bytes) to calculate the byte storage (N) for a DECIMAL(p,s) data type (where N includes the byte that is required to store the exponent and the sign):

If the scale is odd: N = (precision + 4) / 2
If the scale is even: N = (precision + 3) / 2

Reference
http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqlr.doc/sqlrmst111.htm

No comments: