SQL Query on DECIMAL returns characters

5 visualizzazioni (ultimi 30 giorni)
Marek
Marek il 26 Ott 2022
Commentato: Dave Chandler il 7 Dic 2022
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 Commento
Dave Chandler
Dave Chandler il 7 Dic 2022
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?

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by