how to write a sql query with multiple variables

조회 수: 3 (최근 30일)
Siva
Siva 2016년 8월 2일
댓글: Stephen23 2016년 8월 2일
sir, i want to write a SQLquery in which in the where clause i use two variables on two fields.
i tried the following, but getting error messages.
let
x=1; % Variable1
y=4; % Variable2.
curs=exec(conn,['select all from _tablename_ where field1=',num2str(x),and 'field2=',num2str(y)]);
curs=fetch(curs);
I am getting error message.
please guide me.
  댓글 수: 1
Stephen23
Stephen23 2016년 8월 2일
@Mechanical Engineering: please give us the complete error message. This means all of the red text.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by