Incorrect SQL database VariableType using SELECT function
Show older comments
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)
NICK PELEPCHAN
on 21 Feb 2023
0 votes
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!