Function With An INTEGER Parameter Retruning Non-INTEGER Value (Doc ID 1345924.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 10.1.0.5 to 11.2.0.2 - Release: 10.1 to 11.2
Information in this document applies to any platform.

Symptoms

   Passing a value with a decimal to a function which has one INTEGER parameter
returns a decimal.

e.g.
declare
  function test (p integer)
   return INTEGER
   is
   begin
     return p;
   end test;

 begin
    dbms_output.put_line('Must be INTEGER:' || test(0.66));
end;
/

Output:

Must be INTEGER:.66

However this was expected to be an Integer value as shown when same code is run on 9.2 RDBMS.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms