Problem using SQL 'except' command in Matlab Datbase Toolbox
조회 수: 1 (최근 30일)
이전 댓글 표시
Here is the Follwing code I use after i sucessfully connect to a database:
if true
% codes
end
sqlquery=['select *'... %line 17
' FROM test.dbo.chem '...
' where substring(type,1,1) in ''B'''...
' and substring(num,1,6) in( ''800'', ''801'', ''802'',''803'')'
'except'...
'select *'...
'FROM test.dbo.chem'...
'where substring(type,1,1) in ''B'''...
'and substring(num,1,6) in ''800'''...
' order by heatno desc' ];...
curs = exec(conn,sqlquery)'...
curs = fetch(curs)'...
close(curs)
WHEN I RUN THE CODE INBETWEEN THE PARENTHESES BY ITSELF I CAN SUCESSFULLY QUERY THE DATABSE IN A SCRIPT FILE.
HOWEVER WHEN I RUN THE QUERY WITH THE SECTION OF CODE INBETWEEN THE @ SYMBOLS IN CONJUNCTION WITH EVERYTHIGN ELSE (USING AN EXCEPT COMMAND) I GET THE FOLLOWING ERROR:
Error using Collect_tischem_QUAL (line 17) Error using vertcat Dimensions of matrices being concatenated are not consistent.
when done in microsoft sql server management studio the sql part of the code works
when querying just the specific numbers in matlab the code works (using database toolbox)
when querying the specific numbers in matlab with the except command it does not work
any suggestions?
-Pat
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!