Topic
1 reply Latest Post - ‏2013-09-10T11:45:51Z by Bhoju
Muk1234
Muk1234
22 Posts
ACCEPTED ANSWER

Pinned topic inserting a value in a db column having blob as data type

‏2013-09-06T16:52:03Z |

Hi guys , can anyone help me on how to insert a value in a column of db table whose data type is set as BLOB????. I am trying hard but no luck yet. Plz help.

I want to save the contents of the incoming file as a blob in db table.

 

 

Thanks

Muks

 

  • Bhoju
    Bhoju
    37 Posts
    ACCEPTED ANSWER

    Re: inserting a value in a db column having blob as data type

    ‏2013-09-10T11:45:51Z  in response to Muk1234

    Great question.. i havent done this before.. but i can shed some light

    suppose your table contains one blob field, while using INSERT statement, you need to use some sort of function which can read the blob data from a file system (e.g. image or song or video) then execute that function when map is running which will read the data from file and insert it into DB.

    I do not see any other way to insert blob data to table. you can do something like this..

    DBLOOKUP( "insert into <table> values ( <value1>, <value2> ,reafile(filename.png) ,
    "-DBTYPE <DBType> -CONNECT <ConnectionString>" )

    Here readfile function will read the image file from disk and insert it into blob (your third field). Worth testing it Isnt it?