Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 错误:输入参数太多_Sql_Matlab_Input_Arguments - Fatal编程技术网

Sql 错误:输入参数太多

Sql 错误:输入参数太多,sql,matlab,input,arguments,Sql,Matlab,Input,Arguments,我试图在matlab中执行Sql查询。sql使用“select”命令,使用与存储在以下代码中给定的变量中的值相匹配的列名选择特定行。 当我执行此操作时,会出现一个错误:使用==>database.exec太多输入参数时出错 q=value;%computed value. conn1=database('Dbname','',''); fna=exec(conn1,'select * from table1 where ImageName="',q,'"'); fna=fetch(fna);

我试图在matlab中执行Sql查询。sql使用“select”命令,使用与存储在以下代码中给定的变量中的值相匹配的列名选择特定行。 当我执行此操作时,会出现一个错误:使用==>database.exec太多输入参数时出错

q=value;%computed value. 
conn1=database('Dbname','',''); 
fna=exec(conn1,'select * from table1 where ImageName="',q,'"');
fna=fetch(fna); fda=fna.data;

在matlab手册中,它指出exec具有以下语法:

curs = exec(conn,sqlquery)
curs = exec(conn,sqlquery,qTimeOut)

exec函数中有四个参数,这就是错误的含义

要传递四个输入参数,最后三个必须与一个sql命令关联

sqlquery=['select * from table1 where ImageName="',q,'"'];
fna=exec(conn1,sqlquery);

:此外,我将fda的内容存储在一个单元格中。当我试图打印单元格中的内容时,出现了另一个错误:C=fda’;sprintf(“%d%d%d'C{1,1},C{2,1},C{3,1})错误:来自非单元格数组对象的单元格内容引用。