2011-05-18 145 views
0

任何時候我執行下面的代碼,ZendServers記錄下面顯示的錯誤。庫KIVATEST確實存在,該文件ORTXNPF確實存在,而且我能夠執行對這個文件就好了select語句...PHP db2_prepare更新失敗


[18 2011年5月21時30分四十〇秒] PHP的警告:db2_prepare()[function.db2-prepare]:語句準備在第38行的/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php中失敗

[18-May-2011 21:30:40] PHP警告:db2_execute()期望參數1是資源,布爾在39行給出/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php

[18-May-2011 21:30:40] PHP致命錯誤:未捕獲的excep #0 {主} 拋出/網絡/ ZendServer對其進行訪問/ htdocs中:灰 '異常' 與消息中/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php:40

堆棧跟蹤 '無法執行' /dev/Merchandising/ResultSetTesting.php第40行


$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'); 
    } 

回答

2

我不知道爲什麼提供的錯誤是如此的非有用......但問題竟然是,用戶有* USE權限的文件,但不是* ALL ...所以我能夠選擇,但不能更新。

+0

必須愛上有用的錯誤信息!很高興你能解決它! – Leslie 2011-05-23 18:48:44