Oracle PL/SQL - Assigning a Fraction to an Integer

Introduction

A real numeric literal is assigned to a variable defined as an integer.

The output shows that the value was rounded.

Demo

SQL>
SQL> declare--   ww  w.  jav  a2s .  co m
  2      v1_nr NUMBER(10) := 2.567;
  3  begin
  4       DBMS_OUTPUT.put_line('v1_nr='||v1_nr);
  5  end;
  6  /
v1_nr=3

PL/SQL procedure successfully completed.
SQL>

Related Topic