Forum Stats

  • 3,836,763 Users
  • 2,262,184 Discussions


INDEX on RAW data type

728256 Member Posts: 79
edited Feb 3, 2010 5:19PM in General Database Discussions

I read this from a web site. Please let me know fi thsi is correct.

The raw datatype is used to store binary data or binary strings. The maximum size for a raw in a table is 2000 bytes. Within a PL/SQL piece of code, the maximum size is 32767 bytes. The raw datatype is similar to the varchar2. However, Oracle does not interprete the data stored within a raw when applying character set conversion.

If the above is correct them, What happens when I create Index on this column. We have table with Primary key on Raw column. Is this acceptable or a wrong way of creating the table.

Please explain in detail if possible or direct me to a book or URL where I can find the information.

Thanking you


  • 558383
    558383 Member Posts: 6,961 Silver Crown
    edited Feb 3, 2010 5:19PM
    In general, RAW columns can be indexed but LONG RAW cannot.

    See SQL Reference CREATE INDEX section

    Restriction on Index Columns

    You cannot create an index on columns or attributes whose type is user-defined, LONG, LONG RAW, LOB, or REF, except that Oracle Database supports an index on REF type columns or attributes that have been defined with a SCOPE clause.

    Documentation on SQL data types can be found in SQL Reference
    Document on PL/SQL data types can be found in PL/SQL User's Guide and Reference:

    Please post your 4 digits Oracle version.

    Edited by: P. Forstmann on 3 févr. 2010 23:16
This discussion has been closed.