DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: images

  1. #1
    Join Date
    Jan 2002
    Posts
    152
    I am exporting some tables from SQLServer 7.0 to Oracle 8,and there are some image fields (stored as LONG RAW) when you import them into Oracle.But the problem is that only one LONG field is allowed per table.I converted them to CLOB,so I can have several images in one table,but when ASP people want to visualize them,they can't.I'm afraid it is something related to that CLOB field...What can i do to handle my images?
    Thanks

  2. #2
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    If u can't change code of application, bat can change db model (AND TABLE WITH LOB IMAGE_FIELDS HAS PRIMARY KEY), than u can do following:
    1) create number of tables with structure:
    pk_field
    long_raw_fileld
    2) create view, that has structure as SQLServer table.
    3) create instread triggers, that supply insert, update, delete commands on this view.

  3. #3
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    Why CLOB? Images are not character objects and I think you need to use BLOB and then try.

    Raminder Singh

    Oracle Certified DBA: Oracle 8i, 9i


    Mail me at raminderahluwalia@rediffmail.com.

  4. #4
    Join Date
    Jan 2002
    Posts
    152
    Thanks Raminder,I tried BLOb,but if I use BLOB fields,I can't work with that tables and make queries in SQL...I can handle the image but not the table...

  5. #5
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712

    ?

    Please clarify.
    What's the trouble with BLOB and SQL?
    Why you can't work with that tables?

  6. #6
    Join Date
    Jan 2002
    Posts
    152
    I can't make selects from the table with BLOB field.I get :
    SP2-0678: Column or attribute type can not be displayed by SQL*Plus


  7. #7
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    May I ask how you expect SQL*Plus to show you an image?
    I thing the response you got is clear enough: SQL*Plus cannot display an image.
    If you stored an image in CLOB field you'd possibly destroy it because Oracle does converting on CLOB fields. Definitely, you can select that image from CLOB in SQL*Plus but I seriously doubt it would be useful.

    If you need to extract an image to a file and see it you'll have to use some other tool than SQL*Plus (C, Java, VB).

    You can also save it as an external LOB (=file) from within PL/SQL.

    [Edited by ales on 03-26-2002 at 05:16 AM]

  8. #8
    Join Date
    Jan 2002
    Posts
    152
    Yes,I know I can't see an image with SQL*Plus...But maybe I could see the binary code.anyway it doesn't matter,the thing is I import the images in LONG RAW datatype as default from SQL Server,but I only can store one LONG RAW field per table,so the rest of the fields must be converted to BLOB or something.I just wanted to know if I'm doing that right.Another people later will have to see the images from Visual Basic,C or something else as you said...
    Thanks

  9. #9
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    IMHO you should convert all LONG RAWs to BLOBs.

    See manual, there are many useful examples ...

    http://otn.oracle.com/docs/products/...a76940/toc.htm

    And yes, you do that right :-)).

    A.

  10. #10
    Join Date
    Jan 2002
    Posts
    152
    Thanks Ales...I'll have a look to the manual and will try to import all that images at last.
    Regards

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