Incorrect SQL database VariableType using SELECT function

I have a well established database that uses the following schema.
When I attempt to read data from this table (using a complex SQL query, joining mutliple tables), the two colums that are not integers (TSL_DELAY and TSL_WIDTH) are incorrectly interpreted as a SINGLE type (expecting double).
Example data as it appears using MSAccess (left) and after import into MATLAB (right). As you can see, the problem is it is rounding (truncating) the significant digits on the delay value (this is not a display format issue).
This behavior is also present when using the Database Explorer to directly view the table.
I found one other thread (link below) on this issue, but no resolution outside of individually typcasting each column to double (this does work).
https://www.mathworks.com/matlabcentral/answers/770188-double-data-is-loading-as-single-from-database-when-database-reports-double
Polling the userbase to see if anyone has any better solutions to this issue, I'll also submit a bug report linking this forum.

Answers (1)

Looks like this is the intended behavior of the select function at the present. Refer to the table that defines the import data types, shown here.
But my table column is a FLOAT 38 (double) which select imports as a SINGLE 32 data type. This appears to go against the MATLAB standard, as defined on the Floating-Point Numbers help doc; 'MATLAB® represents floating-point numbers in either double-precision or single-precision format. The default is double precision...'.
The bug report I submitted can be found under Case 06032283 or Case 06038586.

Products

Release

R2018b

Asked:

on 14 Feb 2023

Answered:

on 21 Feb 2023

Community Treasure Hunt

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

Start Hunting!