Data type to store longest positive number
Requirement is: A number, lets say count, gets updated based on a certain criteria.
count = count + 1.
This happens at regular intervals.
I have to store this updated value in a table.
What should be the datatype for this field.
There is no restriction on the count. It can be ever increasing.
Raymond Giuseppi replied
There is no datatype able to contain an infinite integer so there is strictly no absolute answer to your question.
Nevertheless you could use a NUMC field, which length can reach 255 characters. (a century lasts only 3.155.760.000 s, so even if your counter is incremented every ms, you have the time to leave...
INT4 could be a little two short (max 2.147.483.647, but you could start at -2.147.483.647)