IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

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

  • 1.  inserting a value in a db column having blob as data type

    Posted 09/06/13 12:52 PM

    Originally posted by: Muk1234


    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

     


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


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

    Posted 09/10/13 07:46 AM

    Originally posted by: Bhoju


    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?


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender