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

Thread: blob

Hybrid View

  1. #1
    Join Date
    Mar 2001
    Posts
    4

    Question

    Hi,

    I have created a table like this:
    CREATE TABLE photo (
    phot_id number(100)
    image blob);

    I want to insert values ! But how ?
    For example, I want to insert an image named nic.jpg which is in the directory C:\Oracle .... What must I do to insert the value in the table ?

    Thanks

    Nic

  2. #2
    Join Date
    Apr 2001
    Posts
    14
    blobs can be manipulated using pl/sql. i don't remember the exact syntaxes and commands for this. you can refer the documentations for this.
    Anil
    anil_tj@yahoo.com

  3. #3
    Join Date
    Apr 2001
    Posts
    4
    hi
    u have to first insert data like this...
    Insert into <>
    Values(1,empty_blob());
    use empty_blob() function for blob column...
    and then write a procedure to insert data...
    I am sending u my procedure Please manipulate it accordingly....


    CRETE OR REPLACE PROCEDURE V_LOAD AS
    ac Blob;
    amount integer;
    a_file bfile := BFILENAME('TEST', 'ITS1.GIF');
    F_LEN NUMBER(6);
    begin
    update <
    > set BLOB_FILE = empty_Blob()
    where BLOB_ID = 1
    returning BLOB_FILE into ac;
    DBMS_LOB.FILEOPEN(a_file, dbms_lob.file_readonly);
    F_LEN:=DBMS_LOB.GETLENGTH(A_FILE);
    amount := F_LEN ;
    DBMS_LOB.LOADFROMFILE(ac, a_file, amount);
    DBMS_OUTPUT.PUT_LINE(F_LEN);
    DBMS_LOB.FILECLOSE(a_file);
    commit;
    update <
    >set BLOB_FILE = ac
    where BLOB_ID = 1;
    end;

    this table has got only two fields....blob_file and blob_id...
    then u can access this data with the help of query...
    regards
    Amit






  4. #4
    There is a perl script you can use, which will do it.. requires to to install DBD and DBI (oracle driver) to use it... then it's fairly easy to use.

    I've seen it on several personal web sites... sorry I don't have it myself, I seem to have lost my copy.

    usually the name is blob.pl

  5. 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