Forum Stats

  • 3,780,825 Users
  • 2,254,445 Discussions
  • 7,879,473 Comments

Discussions

INDEX on RAW data type

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

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
Rocky
Tagged:

Answers

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

    See SQL Reference CREATE INDEX section http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5011.htm#i2182635

    >
    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 http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i54330.
    Document on PL/SQL data types can be found in PL/SQL User's Guide and Reference: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/datatypes.htm#i10924

    Please post your 4 digits Oracle version.

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