필터 지우기
필터 지우기

Database toolbox query not returning all records

조회 수: 2 (최근 30일)
Brian
Brian 2012년 10월 17일
I have a fairly simply SQL query that I am running using the database toolbox connecting to a DB2 datasource. For some reason my query returns different results (usually partial results) each time I run it. It never seems to time out or have any errors. When the query runs properly I get 400,000+ records. As I run the query testing the result, often times I will get 2000-5000 records or so. Seemingly no pattern to the random return of different results. Also, I tried setting the timeout of the SQL query to 100 seconds and that didn't seem to have any impact.
conn = database('Database','UN','pwd');
e = exec(conn,'SELECT ALL END_DT,NASDAQ_SYMBOL,LIPPER_CLASS FROM LIPPER.LIPPER_WEEKLY WHERE END_DT > ''2008-12-31'' AND LIPPER_CLASS IN (''MLCE'',''MTAG'',''MTAM'',''MTAC'') AND NASDAQ_SYMBOL <> '''' AND UNIVERSE = ''EQ'' ',100);
e = fetch(e);
I'm fairly puzzled here, any help would be appreciated.
Thanks, Brian
  댓글 수: 3
Sean de Wolski
Sean de Wolski 2012년 10월 17일
i.e.:
e1 = fetch(blah);
e2 = fetch(blah);
e3 = fetch(blah);
isequal(e1,e2,e3)
Brian
Brian 2012년 10월 17일
Yes I do, it seems almost completely random. One time I'll get 400000+ records, one time I'll get 5500 and the third time I'll get No Data.

댓글을 달려면 로그인하십시오.

답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by