简体   繁体   English

MSSQL查询exec返回错误

[英]Mssql query exec returns error

I'm connected to a sybase db through php's mssql driver. 我通过php的mssql驱动程序连接到sybase数据库。

When I run this sql query: 当我运行此sql查询时:

$result = mssql_query("exec taxKM $rate, $var, $days, $discount, $distance, $inDate, $outDate, null", $cnx);

I get this error: 我收到此错误:

Warning: mssql_query(): message: ASA Error -188: Not enough values for host variables (severity 16)

I'm following the taxKM procedure specs. 我正在遵循taxKM程序规范。

It seems there are missing values, isn't it? 似乎有缺失的值,不是吗?

But if I'm following the specs, it has to do with wrong function specs? 但是,如果我遵循规范,则与错误的函数规范有关吗?

I guess you have to properly quote the non-numeric procedure-arguments in the string , so instead of 你必须在字符串中正确地引用非数字过程参数,所以代替

mssql_query("exec taxKM $rate, $var, $days, $discount, $distance, $inDate, $outDate, null", $cnx)

try this 尝试这个

mssql_query("exec taxKM $rate, '$var', $days, '$discount', $distance, '$inDate', '$outDate', null", $cnx)

or similar 或类似

Aside from that, I don't know if ASA - Sybase Adaptive Server Anywhere can be accessed with the php-mssql driver. 除此之外,我不知道是否可以使用php-mssql驱动程序访问ASA-Sybase Adaptive Server Anywhere。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM