Results 1 to 13 of 13
  1. #1
    Join Date
    Aug 2011
    Posts
    3

    Thumbs up Unanswered: How to insert images in oracle

    Hi to all,

    Hai Friends I would like to create a table like emp, as employee has his own name, number,salary, I want to put image of each employee in my table. is it possible? . If yes, please tell me the procedure I am new to oracle.

    Thanks in Advance.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I am new to oracle.
    Are you new to the Internet?
    Consider using GOOGLE to find answer to this Frequently Asked Question.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    The answer is yes, make a blog column and store the image file in it.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    LOL, that would be a BLOB (not blog) column

  5. #5
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    LOLOL, love those typos. Thanks
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  6. #6
    Join Date
    Sep 2011
    Posts
    20
    Quote Originally Posted by DB2Anil View Post
    I want to put image of each employee in my table. is it possible?
    Let me try to help because:

    1. This is a forum where people post questions here to seek help, no matter how stupid the question is
    2. The pages in this forum including this post will be pick up by Google, someone else googling a topic using keywords from this page, will get this page that has no answer and yet the suggested action is to google it!
    3. I am new to Oracle, I try to teach others while I hope others will teach me
    Here is what I found:

    Create a table containing a BLOB column:

    Code:
    CREATE TABLE lob_table (id NUMBER, doc BLOB);
    INSERT INTO lob_table VALUES (1, EMPTY_BLOB());
    Load an external file into the table:

    Code:
    DECLARE
      src_lob  BFILE := BFILENAME('MY_DIR', '/tmp/me.gif');
      dest_lob BLOB;
    BEGIN
      INSERT INTO lob_table VALUES(2, EMPTY_BLOB())
         RETURNING doc INTO dest_lob;
      DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
      DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob,
                             SRC_LOB  => src_lob,
                             AMOUNT   => DBMS_LOB.GETLENGTH(src_lob) );
      DBMS_LOB.CLOSE(src_lob);
      COMMIT;
    END;
    /
    Last edited by teachme; 09-30-11 at 16:44.

  7. #7
    Join Date
    Sep 2012
    Posts
    9
    i also want to know this.
    i created a table with a column;
    photo blob,

    now how do i add a picture to it? i got this far but what am i doing wrong?

    insert into tablename ('blabla',111111,'12-jan-1993','moreblabla',c:\image.jpg);

    clearly the last part is wrong, but how should i correct it so that it will work?


    ps to all ppl flaming about stupid questions and saying like use google, im new to sql and googled it for half an hour but didnt understand it.
    guess we all started from nothing.

  8. #8
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >insert into tablename ('blabla',111111,'12-jan-1993','moreblabla',c:\image.jpg);

    File, image.jpg, must reside on DB Server & I suspect image.jpg resides on your client PC.
    If so, you can't get there from here.

    post results from following SQL

    SELECT * FROM V$VERSION;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  9. #9
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by anacedent View Post
    File, image.jpg, must reside on DB Server & I suspect image.jpg resides on your client PC. If so, you can't get there from here.
    Well, that depends on the SQL client being used.
    I know at least one tool which can do that kind of thing (specify a local file to be used for a BLOB column) - not SQL*Plus of course.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  10. #10
    Join Date
    Sep 2012
    Posts
    9
    i use sql developer, and im new to coding so its hard to understand some words haha

    and since im new can you like type it in a row like this;

    insert into tablename values (blabla,etc,your answer here);
    its really confusing
    Last edited by roydorsthorst; 09-15-12 at 10:08.

  11. #11
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    I don't use SQL Developer, but I'm sure the manual would describe how to do such a thing if it was possible.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  12. #12
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    how will you or I recognize when any posting is deemed to be correct?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  13. #13
    Join Date
    Sep 2012
    Posts
    18
    create table and column datatype blob.

Tags for this Thread

Posting Permissions

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