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.
回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!