Wrong data-size being returned by 'FETCH' (64-bit, DatabaseToolBx)

2 ビュー (過去 30 日間)
Madhuresh
Madhuresh 2012 年 4 月 18 日
回答済み: Aubai 2017 年 4 月 19 日
Hi,
I have a GETDATA.m file on my machine which has 32bit Matlab on WinXP. The same file is also run from a server which has 64bit Matlab on WinServer2003.
GETDATA executes a stored procedure and returns the result table. Its normal output is 8000 rows (approx) and 4 cols. The data is alphanumeric.
Problem --> GETDATA behaves erratically when run from the 64bit server. The number of rows returned is random! The same file when run from my local machine around the same time returns the right data.
The 64bit server runs other stored procedures as well and they all return correct data. The problem occurs only in GETDATA.m file! The code looks like:
setdbprefs('DataReturnFormat', 'cellarray');
conn = database(name,login,password);
curs = exec(conn, SQLstoredp_withParameters);
RequiredData = curs.Data; %Wrong number of rows
close(conn)
close(curs)
I have spent hours debugging it but I cannot resolve it. Thanks!

回答 (3 件)

Titus Edelhofer
Titus Edelhofer 2012 年 4 月 18 日
Hi,
strange indeed. Does curs.Message display anything useful? BTW: I would first close curs, then conn, but that's of course not the problem you see ...
Titus
  2 件のコメント
Madhuresh
Madhuresh 2012 年 4 月 18 日
Hi Titus --> no it doesn't. I just cannot explain whats going wrong. This situation is like this: My file1 is called and that calls GETDATA to fill a persistent variable in an Intermediatefile. File1,File2,..126 are processed and then GETDATA is called again to fill another persistent variable in the Intermediatefile. Problem occurs with the second call to GETDATA. If you run just File1,..to..File10, problem will still persist. The only way to avoid it is run GETDATA twice initially and then process File1,...File126!
Titus Edelhofer
Titus Edelhofer 2012 年 4 月 19 日
Hi Madhuresh, in this case I have no clue how to diagnose the problem without looking directly onto it, I must admit, I have no further idea. You might contact MathWorks Technical Support, perhaps they can help you diagnose the problem ...

サインインしてコメントする。


Christophe
Christophe 2012 年 6 月 18 日
Hi,
I have exactly the same issue. 2 same fetch functions are behaving differently between a 64 bit machine and a 32 bit. The 64 beeing the one that doesn't work properly.
  1 件のコメント
Madhuresh
Madhuresh 2013 年 5 月 10 日
While I could never resolve this issue, I learned some valuable lessons - such problem occurred with only string type data and not integer. I actually updated all my SQL codes to return the number of rows as the top most row. Matlab now verifies that the top row = remaining_number_of_rows. If not, the code is re-run.

サインインしてコメントする。


Aubai
Aubai 2017 年 4 月 19 日
Did Anyone get answer for this question??
I am having the same Problem here

カテゴリ

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