Question : If i increase the size of a field in mysql is it effect anything?

If i increase the size of a field in mysql is it effect anything?

This table is in production and lot of programs are using this.

field is UNIT_PRICE            decimal(15,4)  and i want to increase its size by 6 in decimal place . that is decimal(17,6) right?

for example now value is 23,456.7896 i want six degits after decimal that is 23,456.007896

Regards

Answer : If i increase the size of a field in mysql is it effect anything?

Increasing the field type to decimal(15,6) will not have any effect on existing data; 123.4567 will become 123.456700, which is an equivalent value.

Depending on the programs that access the database, this may reflect in text output, i.e. trailing zeroes may appear in textual values retrieved from the database field, but will not affect numeric calculations. My recommendation would be to verify most (or the important) programs that access the database first, if possible accessing a test database with the field type changed, to verify correct output (reports, labels etc). Or, at a stretch, announce half an hour of downtime, switch the field and do some quick verifications on the software side; if there's anything that doesn't look right, change the field back to less decimals (faster than a full backup/restore), which will also not affect data, and work on getting the software patched up - the problem will never be in the database itself unless there are triggers that validate data or something similar.
Random Solutions  
 
programming4us programming4us