Skip to Content
0
Jul 17, 2020 at 02:38 AM

InternalError: dberror(setString): 339 - invalid number: not a valid number string

83 Views Last edit Jul 17, 2020 at 02:43 AM 2 rev

Hello all,

I created a simple XSJSLIB with oData custom exit in HANA XS Classic and write a code to insert the date into database.

Date type in table is defined as:

{name = "CREATTION_DATE";  sqlType = DATE;  comment = "Creation Date- YYYYMMDD";},

Here is the code in XSJSLIB:

query = "INSERT INTO \"COMMON\".\"PROD.TEST.TABLE::TEST\" (DATE) VALUES(DATE) "; 
pStmt = param.connection.prepareStatement(query);  
pStmt.setString(1, '2020-07-16');
pStmt.executeUpdate(); 
pStmt.close();

I am getting this error :

Create Entity failed: :Service exception: [2] InternalError: dberror(setString): 339 - invalid number: not a valid number string '2020-07-16' (line 73 position 1 in /TEST_SUBMITDATA.xsjslib)

Any idea how to fix it? Appreciate.