SQL Query on DECIMAL returns characters

조회 수: 5 (최근 30일)
Marek
Marek 2022년 10월 26일
댓글: Dave Chandler 2022년 12월 7일
Hi,
I have an SQL-Query (SELECT * FROM MyTable) which is executed on a Microsoft SQL Server. One column is formattet as DECIMAL(18,10) not nullable in the SQL table, but the reuslt in Matlab is characters, and aslo the decimal point is returned as a comma.
So instead of 11229.3 I get '11229,3'
An other column which is INT works correctly and I have a number in Matlab.
(Maybe this has something to do with the interchanged comma and decimal point in Germany? For Example in Excel we have 11.229,3 but Matlab and SQL both usually have the number format like this: 11229.3)
Of course I can somehow in Matlab convert the string to a number, but I am looking for a clean solution.
Thanks for the support.
  댓글 수: 1
Dave Chandler
Dave Chandler 2022년 12월 7일
A little more information might be helpful:
Are you using a JDBC or ODBC driver?
Which version of MATLAB are you using?
Can you share sample code on how you are fetching the data?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by