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