cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to avoid unexpected null error while inserting data into MSSQL virtual table from SAP HANA?

leonardschwenk
Explorer
0 Kudos
540

Hi everyone,

I encounter a strange error.

I try to insert the following:

INSERT INTO "usertable.virtualtable::VT_usertable" (
"ID", -- integer
"name", -- NVARCHAR(128)
"birthday", -- date
"account_balance") -- decimal 
VALUES (1, myname, 20200130, NULL)

And get this error message:

Could not execute 'INSERT INTO ...'

Error: (dberror) [403]: internal error: Error executing query [Microsoft][ODBC Driver 17 for SQL Server]Invalid precision value for query " INSERT INTO "remote_source"."dbo"."usertable" ( "ID", "name", "birthday", "account_balance") VALUES (?, ?, ?, ?)"

I can not insert any null value into my decimal field "account_balance" and no its not a primary key or not nullable

.

When I delete the field "account_balance" the INSERT query is not throwing an error. HANA will fill the field with NULL but it works. Only when I specify the value it will throw the error

When I insert directly into to MSSQL I wont get that error even if the value is specified as null.

Versions:

SAP HANA Version: 2.00.050.00.1592305219 (fa/hana2sp05)

ODBC version 17.6

MSSQL version 13.0.04

Accepted Solutions (0)

Answers (0)