Matlab data type inconsistence for cursor.data when running matlab code in MCR and Matlab studio

1 回表示 (過去 30 日間)
I have a piece of matlab code below which reads data from a table. When I run this code in Matlab studio, the cursor.data type is cell array. But when I use my Java code to run this code in MCR, the cursor.data type is double array. My Matlab Studio version is 2012a. My MCR version now is 2011b. I'm trying to upgrade my MCR version to 2012a. Besides the possible version issue, does anybody know other possible reason which causes this issue? Thanks!
cur = exec(conn, ['SELECT CAST(Customer_Key AS NUMERIC(38,6)), CAST(Product_Key AS NUMERIC(38,6)), Spend FROM ' inputTable]); cursor = fetch(cur);

回答 (1 件)

owr
owr 2012 年 6 月 25 日
I no longer have access to the database toolbox, but it sounds like it could be related to the preference you have set for the "DataReturnFormat". Check in your code to see if you are calling "setdbprefs" or something similar:

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by