Converting BLOBs
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Converting BLOBs

  1. #1
    Join Date
    Apr 2001
    Posts
    55

    Question Converting BLOBs

    Does anyone know how i can convert a BLOB data type into LONG RAW format.

    I know i can use the TO_LOB function to convert LONG RAW into BLOB format but is there a way of converting the other way?!?!?

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    according to metalink

    http://metalink.oracle.com/metalink/...&p_id=203882.1

    goal: How To Convert A Blob Content To Long Raw
    fact: Oracle Server - Enterprise Edition 8.1.7
    fact: Solaris Operating System (SPARC)



    fix:

    The solution can include writing an oci or pro*C progam, but it is possible to
    use the UTL_RAW package that is available with the server. The one thing to
    bear in mind is when manipulating the long raw in PL/SQL it has to be done in
    one piece and there is a limit of 32k, so if the data is larger then this it
    may not be very successful. Specifically, look at utl_raw.cast_to_raw to
    achieve this.

    HTH
    Amar
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Last edited by adewri; 01-08-2003 at 12:16 PM.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  4. #4
    Join Date
    Apr 2001
    Posts
    55
    thanks for that link but unfortunately i don't have a username and password to be able to access that link.

    Do you how i use the UTL_RAW package. I'm not too familiar with it.

  5. #5
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Last edited by adewri; 01-08-2003 at 12:14 PM.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  6. #6
    Join Date
    Apr 2001
    Posts
    55
    I'm still having some trouble using this package.

    I am obvously not getting the sytax correct. The column i want to convert is called IMAGE_DATA.

    I thought that if i perform the following it would have worked.
    Begin
    UTL_RAW.CAST_TO_RAW(IMAGE_DATA) ;
    ENd;

    Would have worked. Can anyone tell me what i'm doing wrong?
    Last edited by hummy; 01-08-2003 at 12:21 PM.

  7. #7
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    oops...

    The UTL_RAW package is installed when the database is installed, and its source code can be found in the utlraw.sql script. If this script is not installed automatically, then run utlraw.sql and prvtrawb.plb script as SYS. These files can be found under the admin directory.

    HTH
    Amar

    PS: sorry for saying that utl_raw was OS dependant
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  8. #8
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    im attaching the metalink doc for you

    HTH
    Amar
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  9. #9
    Join Date
    Apr 2001
    Posts
    55
    Thanks....i managed to see the doc from one of the links you sent.....and when applying it i seem to be having problems.

    Any ideas? The column i'm trying to convert is called image_data

  10. #10
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    What problems are you getting...

    any particular error messages...

    what syntax or command did you type...
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width