Mahtab Alam wrote:But since precision was 4 I was expecting above insert statement to fail.
The trick is that you specified a negative scale. Negative scale means that some digits to the left of decimal points will always be zero. These digits do not count towards precision - they don't hold any useful information.
For a given scale and precision of Oracle number, the maximum number of digits to the left of decimal point can be expressed as
precision - scale. So, negative scale allows for more digits to the left of the decimal point, but only some of them (the amount given by
precision) will keep any useful information. Writing the numbers in scientific notation would help you to understand what "precision" actually means.
Another rather confusing situation can arise when scale is greater than precision, which means
precision - scale is negative. In this case, there will be at least
scale - precision zero digits
to the right of the decimal point. Consider: