2024 Sep 12 1:07 PM - edited 2024 Sep 12 1:08 PM
We execute SELECT statements in our .NET 8.0 app via the ODBC driver on HANA systems and receive the error message mentioned in the subject line.
Characteristics of the affected system:
- SAP Business One 10.0 version for SAP HANA (10.00.260) SP 2408 (64-bit)
- HDBODBC (64-bit) 2.20.22.39682
The problem only occurs when SAP fields are retrieved that have the data type NVARCHAR(1) with a default value. For example: OWHS.Locked
SELECT "Locked" FROM "OWHS"
The problem no longer occurs for these fields if their data type is changed via the CAST command, e.g. to VARCHAR(1).
SELECT CAST("Locked" AS VARCHAR(1)) FROM "OWHS"
In all other systems that are equipped with older SAP Businnes One and HDBODBC versions, this problem does not occur.
Our workaround:
Disable the observance of constraints, .NET-Code:
DataSet dataSet = new DataSet { EnforceConstraints = false };
DataTable result = dataSet.Tables.Add();
ExecuteOnDbCommand(command, commandAction => result.Load(commandAction.ExecuteReader()), setSchemaContext);
return result;
Request clarification before answering.
User | Count |
---|---|
11 | |
7 | |
7 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.