每当我执行下面的代码时,ZendServers 都会记录如下所示的错误。 库 KIVATEST 确实存在,文件 ORTXNPF 确实存在,我能够对这个文件执行一个 select 语句......
[2011 年 5 月 18 日 21:30:40] PHP 警告:db2_prepare() [function.db2-prepare]:语句准备失败,第 38 行/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php
[2011 年 5 月 18 日 21:30:40] PHP 警告:db2_execute() 期望参数 1 是资源,布尔值在第 39 行的/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php 中给出
[2011 年 5 月 18 日 21:30:40] PHP 致命错误:未捕获的异常"异常",在/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php:40 中显示消息"无法执行"
堆栈跟踪: #0 {主要} 扔在第 40 行/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php
$connection = db2_connect ( "*LOCAL", "", "" );
if (! $connection) {
Throw New Exception('Could not connect');
}
//Prepare and execute the SQL statement.
[[LINE 38]] $stmt = db2_prepare ( $connection, "UPDATE KIVATEST.ORTXNPF SET otbfnm = 'AdamTest' where ottxn# = 216807" );
if (! db2_execute ( $stmt ) ) {
Throw New Exception('Could not execute');
}
我不确定为什么提供的错误如此无用......但问题是用户对文件具有 *USE 权限,但不是 *ALL...所以我能够选择但不能更新。