'Issue with importing Image into CLOB data using TPT script

I have a simple tpt script (given below) to load image into CLOB column in an empty table.

USING CHARACTER SET UTF8
DEFINE JOB LoadingtableData
DESCRIPTION 'Loading data into table using TPT' 
    (
        DEFINE SCHEMA TableStaging
        DESCRIPTION 'SYS FILE Staging Table'
        (
             Col_Colb CLOB(131072) AS DEFERRED BY NAME
            ,Col_FNAME VARCHAR(100)
            ,Col_ID VARCHAR(50)
            );
        DEFINE OPERATOR FileReader()
        DESCRIPTION 'Read file with list'
        TYPE DATACONNECTOR PRODUCER
        SCHEMA TableStaging
        ATTRIBUTES (
        VARCHAR TraceLevel = 'None'
        , VARCHAR PrivateLogName = 'read_log'
        , VARCHAR FileName = 'datafile.txt'
        , VARCHAR OpenMode = 'Read'
        , VARCHAR Format = 'Delimited'
        , VARCHAR TextDelimiter = ',');
DEFINE OPERATOR SQLInserter()
    DESCRIPTION 'Insert from files into table'
    TYPE INSERTER
    INPUT SCHEMA TableStaging
ATTRIBUTES (
    VARCHAR TraceLevel = 'None'
    , VARCHAR PrivateLogName = '@LOG'
    , VARCHAR TdpId = '@TdpId '
    , VARCHAR UserName = '@UserName '
    , VARCHAR UserPassword = '@UserPassword ');
    STEP LoadData (
        APPLY ('INSERT INTO table_A(Col_Colb,Col_FNAME,Col_ID) VALUES (:Col_Colb,:Col_FNAME,:Col_ID);')
        TO OPERATOR (SQLInserter [1])SELECT * FROM OPERATOR (FileReader ());););

To load data into table I'm using two text files:

  1. File have all the Varchar column values and Clob data location. Example data in file: <Clob_File_Location>,Name,123
  2. Clob column value Example data in file: Image.png

After executing the above tpt, I get message as "data loaded successfully". But when I check the table in place of image in Clob column text is loaded.

Can someone help in letting me know what I might be doing wrong.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source