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

Home -> Community -> Usenet -> c.d.o.misc -> Oracle Datatypes: RAW x BLOB, FLOAT x NUMBER

Oracle Datatypes: RAW x BLOB, FLOAT x NUMBER

From: Renato Fabiano <renatofabiano_at_hotmail.com>
Date: 25 Oct 2001 06:07:50 -0700
Message-ID: <2358ca76.0110250507.1eac0f99@posting.google.com>


Hi guys,

I would like to solve a few questions about Oracle 8i datatypes.

(1) RAW x BLOB

I am going to store some binary data into the Oracle db. This data will be always shorter than 2000 bytes, that is the size limit for RAW columns.
I have decided to use RAW datatype.

Is this the best choice in this case?

Does the RAW datatype exist in Oracle 9i?

I will give you some more information:

Accordingly to Oracle 8i Concepts (ref A67781-01) manual, "The RAW and LONG RAW datatypes are provided for backward campatibility with existing application"; and it suggests to use BLOB datatype instead.
I guess this is a mistake in manual, and this is truth just comparing BLOB with LONG datatype. But it's false comparing BLOB with RAW columns, that are shorter than 2000 bytes. Am I right?

BLOB is much better comparing with LONG, because it has less restrictions, but it is much more difficult to use and has more restrictions when camparing with RAW. Although (any) LONG datatype are very restritive, the same doesn't happens with RAW.

(2) FLOAT versus NUMBER

Oracle Concepts manual doesn't refer to FLOAT datatype as an internal datatype.

If you execute the follow command in SQL*Plus: create table test
(n38 NUMBER(38), f38 FLOAT(38), f125 FLOAT(125), FLOAT(126));

The columns named n38 and f38 will have the same datatype = NUMBER(38). The column f125 will have the NUMBER(125) datatype.
=> But The column f126 will have the FLOAT(126) datatype!

The facts are:

FLOAT(t), t varrying from 1 to 38 are converted to NUMBER(t)
FLOAT(x), x varrying from 39 to 125 are converted to NUMBER(x)
FLOAT(y), y equal 126 is created as FLOAT(126)
NUMBER(z), z varrying from 1 to 38 is created as NUMBER(z) NUMBER(a), a varring outside 1 to 38 generates an error "out of range (1 to 38)"

I know that NUMBER is more precise than FLOAT, and I have some questions:

  1. Is FLOAT an internal datatype or not?
  2. How is it possible to create a NUMBER column longer than 38 bytes of precision using FLOAT(x) sintax?
  3. Why FLOAT(126) is not converted to NUMBER(126)?

Thanks in advance,

Renato Fabiano Received on Thu Oct 25 2001 - 08:07:50 CDT

Original text of this message

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