Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Problem when inserting BLOB object in $.hdb API

$
0
0

Hi,

 

I am trying to insert an object (file) into BLOB column in HANA through $.hdb API (new XSJS API).

 

The code is as follows:

 

case "UPLOAD":

var conn=$.hdb.getConnection();

                                    

var file_name = $.request.headers.get("slug");

 

//var file_content = $.request.body.asString(); // Returns the content as string


var file_content=$.request.body;// I tried to use this to insert the file as it is into the BLOB column.


 

var stmt = "INSERT INTO \"IBASS\".\"ibass.IBASS_1.DATA::TABLE_DEFINITIONS.BA_TASKS_ATTACHMENTS\" "+

             "VALUES (?,?,?,?,?)";

conn.executeUpdate(stmt,4,'1',file_name, file_content, 'PDF');

conn.commit();

 

 

The response is


Viewing all articles
Browse latest Browse all 9165

Trending Articles