SQL query to Oracle - Only getting integer part of numeric columns
古いコメントを表示
I have just bought the database toolbox so I am not very familiar with this. I want to retrieve data from an Oracle database. Each row in my dataset contains both string columns and numeric columns. I have set the DataReturnFormat to 'table'.
The columns that contain strings look fine in my result table but the numeric columns only have the integer part, i.e. 101.37 becomes 101, 0.0425 becomes 0 etc.
Running the same query in AQT gives me the correct data. (That is the way I used to do it - either AQT and export to excel and xlsread from Matlab or running the query in VBA + xlsread)
There is probably a simple change in settings that fixes this but right now this eludes me.
Regards,
Niclas
6 件のコメント
Geoff Hayes
2014 年 7 月 25 日
Niclas - What is the code that you are using to build the query and extract the data? What happens if you use cellarray (the default) instead of table?
Niclas Engberg
2014 年 7 月 25 日
Geoff Hayes
2014 年 7 月 25 日
Which fields should be retuned as real (non-integer) numbers?
Try the following - build your query selecting just one of these fields that should be returned as a real number. Use the same from and where conditions. Run the query and observe the results - is the data for that one field returned as an integer or not?
Niclas Engberg
2014 年 7 月 28 日
Niclas Engberg
2014 年 7 月 28 日
Geoff Hayes
2014 年 7 月 28 日
Awesome that you figured it out!
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!