Subject | Re: [firebird-support] Raising the scale of a NUMERIC field |
---|---|
Author | Carlos H. Cantu |
Post date | 2012-10-29T16:48:55Z |
MR> No, a direct system table update like that would rescale all your existing
MR> numbers. Eg from (15,4) to (15,8) a value 54321.1234 would become
MR> 5.43211234
Not really. You can test by yourself... seems that stored values are
associated with a record in RDB$FORMATS that describes the original
format when they were stored, and when FB retrieves the value, it
respects the original format (thanks Ivan for the note).
My tests showed no problem with my proposed approach. I posted here
just to make sure that it would not have any side effects that I didnt
see yet. If someone knows any, please post here.
[]s
Carlos
Firebird Performance in Detail - http://videos.firebirddevelopersday.com
www.firebirdnews.org - www.FireBase.com.br
MR> On Mon, 29 Oct 2012 13:32:16 -0200, "Carlos H. Cantu"
MR> <listas@...> wrote:
MR> numbers. Eg from (15,4) to (15,8) a value 54321.1234 would become
MR> 5.43211234
Not really. You can test by yourself... seems that stored values are
associated with a record in RDB$FORMATS that describes the original
format when they were stored, and when FB retrieves the value, it
respects the original format (thanks Ivan for the note).
My tests showed no problem with my proposed approach. I posted here
just to make sure that it would not have any side effects that I didnt
see yet. If someone knows any, please post here.
[]s
Carlos
Firebird Performance in Detail - http://videos.firebirddevelopersday.com
www.firebirdnews.org - www.FireBase.com.br
MR> On Mon, 29 Oct 2012 13:32:16 -0200, "Carlos H. Cantu"
MR> <listas@...> wrote:
>> I need to change the scale of numeric domain from (15,4) to (15,8).
>>
>> I cannot use the ALTER command, since FB doesn't allow such change.
>> BUT I'm 100% sure that all the existing data would perfectly fit in
>> (15,8) so, the question is: In this case, is it safe to make the
>> change direct in the system table?
>>
>> update RDB$FIELDS set
>> RDB$FIELD_SCALE = -8
>> where RDB$FIELD_NAME = 'RDB$nnnn';