Tuesday, January 31, 2006

INTEGER Type is Platform-Independent shock

We are grateful to oracleplsqlprogramming.com for their December 2005 Tip of the Month: Insights into PL/SQL Integers, in which we learn this:

INTEGER - defined in the STANDARD package as a subtype of NUMBER, this datatype is implemented in a completely platform-independent fashion, which means that anything you do with NUMBER or INTEGER variables should work the same regardless of the hardware on which the database is installed.

And thank goodness for that, is what we say. Sometimes you just don't need platform-dependent results from your PL/SQL integer calculation depending on the hardware on which the database is installed.

3 comments:

Noons said...

Took me a while to figure out what was wrong with Steve's claim. Man! I'm slow, today...

Scott Swank said...

I for one think it'd be kinda nice if Oracle had platform-dependent arithmetic -- like if you had to remember that everything was base-14 when you were running Oracle on an Amiga.

William Robertson said...

PLS_INTEGER would be blazingly fast due to its hardware arithmetic, but we would have to use conditional compilation to do platform-specific base conversion depending on DBMS_UTILITY.PORT_STRING. It all sounds a lot more fun than the boring old full portability currently on offer.