change long row to blob

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tracy

    change long row to blob

    I plan to change the datatype from long raw to blob as from tables
    stud_photo and cimpant _image below. But i am not sure if it is a good
    idea. pls advise.
    TQ!


    SQL> DESC STUD_PHOTO;
    Name Null? Type
    ------------------------------- -------- ----
    STUD_ID NOT NULL VARCHAR2(15)
    STUD_PHOTO LONG RAW
    STUD_UPD_BRANCH VARCHAR2(1)
    STUD_DATETIME DATE

    SQL> DESC CONPANY_IMAGE;
    Name Null? Type
    ------------------------------- -------- ----
    IMAGE_ID NOT NULL VARCHAR2(10)
    IMAGE LONG RAW
  • Romeo Olympia

    #2
    Re: change long row to blob

    Sure, go ahead. LONG datatypes are there mostly for backward
    compatibility. For new applications or existing ones that allow it
    (and often do), go for LOBs. Most of the restrictions that go with
    using LONG datatypes are not an issue when using LOB datatypes.

    tracykim10@yaho o.com.hk (tracy) wrote in message news:<5c91cce9. 0406212356.5291 75ec@posting.go ogle.com>...[color=blue]
    > I plan to change the datatype from long raw to blob as from tables
    > stud_photo and cimpant _image below. But i am not sure if it is a good
    > idea. pls advise.
    > TQ!
    >
    >
    > SQL> DESC STUD_PHOTO;
    > Name Null? Type
    > ------------------------------- -------- ----
    > STUD_ID NOT NULL VARCHAR2(15)
    > STUD_PHOTO LONG RAW
    > STUD_UPD_BRANCH VARCHAR2(1)
    > STUD_DATETIME DATE
    >
    > SQL> DESC CONPANY_IMAGE;
    > Name Null? Type
    > ------------------------------- -------- ----
    > IMAGE_ID NOT NULL VARCHAR2(10)
    > IMAGE LONG RAW[/color]

    Comment

    • cs

      #3
      Re: change long row to blob

      Hi

      you can change the datatype of the column by using alter command

      here is the example

      database version 9.2.0.4

      sys@ORCL$ create table company_image(i mage_id varchar2(10),
      image long raw);

      sys@ORCL$ alter table company_image modify image blob;

      Table altered.

      sys@ORCL$ desc company_image
      Name Null? Type
      -----------------------------------------
      IMAGE_ID VARCHAR2(10)
      IMAGE BLOB



      sekhar

      Comment

      Working...