Home » SQL & PL/SQL » SQL & PL/SQL » about pls_integer
about pls_integer [message #1794] Thu, 30 May 2002 07:00 Go to next message
pavani
Messages: 32
Registered: April 2002
Member
can any body plz help me knowing about pls_integer in pl/sql...where it shoiuld be used an so...
any help 'll be apreciated
thanks
Re: about pls_integer [message #1796 is a reply to message #1794] Thu, 30 May 2002 08:44 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
From the docs:

You use the PLS_INTEGER datatype to store signed integers. Its magnitude range is -2**31 .. 2**31. PLS_INTEGER values require less storage than NUMBER values. Also, PLS_INTEGER operations use machine arithmetic, so they are faster than NUMBER and BINARY_INTEGER operations, which use library arithmetic. For efficiency, use PLS_INTEGER for all calculations that fall within its magnitude range.

Although PLS_INTEGER and BINARY_INTEGER have the same magnitude range, they are not fully compatible. When a PLS_INTEGER calculation overflows, an exception is raised. However, when a BINARY_INTEGER calculation overflows, no exception is raised if the result is assigned to a NUMBER variable.

Because of this small semantic difference, you might want to continue using BINARY_INTEGER in old applications for compatibility. In new applications, always use PLS_INTEGER for better performance.
Previous Topic: Getting number of records in oracle 8.0.5
Next Topic: long to a long in a trigger barf
Goto Forum:
  


Current Time: Tue May 21 13:45:20 CDT 2024