Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Number and Integer

RE: Number and Integer

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Wed, 05 Sep 2001 06:44:33 -0700
Message-ID: <F001.003832CD.20010905054649@fatcity.com>

Following might help ...

PL/SQL supports PLS_INTEGER as a native datatype: the operations on PLS_INTEGER are performed by the PL/SQL interpreter itself. Numeric types, such as INTEGER and NUMBER, are represented in the 22 byte Oracle number format. Oracle number libraries are used to implement arithmetic operations on these types. Furthermore, the INTEGER type is a constrained subtype of NUMBER with a precision of 0. On assignments to INTEGER variables, precision checking is done at run-time. Both PLS_INTEGER and BINARY_INTEGER are both represented as a signed 4-byte quantity ("sb4"). But, BINARY_INTEGER arithmetic is costly: the operands are first converted to Oracle number and then the Oracle number library is used to compute the result as another Oracle number. This results in increased use of temporaries and data conversion, and, hence, poor performance. On the other hand, native integer arithmetic is used to efficiently implement arithmetic operations on PLS_INTEGERs. The numeric types NATURAL, NATURALN, POSITIVE, POSITIVEN, and SIGNTYPE are subtypes of BINARY_INTEGER (refer to [5] for details) with "stricter" range constraints. There is considerable overhead (about 3-4 byte-code instructions) in the enforcement of these range constraints on every assignment (or parameter passing) to variables of these types.

HTH
Raj



Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art !

*********************************************************************1

This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.

*********************************************************************1

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Sep 05 2001 - 08:44:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US