Consultor Eletrônico



Kbase P92665: How can I change the precision of decimal fields in my database?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/12/2008
Status: Verified

GOAL:

How can I change the precision of decimal fields in my database?

GOAL:

The precision of decimal fields in my database are wrong, how can I fix them?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Database

FIX:

There are two ways to change the precision of decimal fields in the database.

If there are only a few fields to change then do the following:

1) Open the Data Dictionary.
2) Connect to the database.
3) Find the decimal field whose precision needs to be changed.
4) Double click the field to open its 'Field Properties' window.
5) Change the 'Decimals' field to whatever precision is required (default is 2).
6) Change the 'Format' field so that it contains the appropriate number of decimal positions.
7) Repeat starting at step 3 until all decimal fields have been changed.

If there are too many fields to change using the above method then use the following:

1) Dump a .df containing every table that has fields that need to be changed.
2) Dump the .d for each table that was selected in step 1.
3) Delete each table that was selected in step 1.
4) Use a text editor to modify each decimal field in the the .df file as follows:
A) Change the DECIMALS line so that the correct number of decimals is used.
B) Change the FORMAT line so that the correct number of decimal positions is displayed.
5) Save the modified .df file.
6) Load the modified .df file into the database.
7) Load the .d files for each table into the database.