2015-04-06 68 views
-1

對於oracle系統生成軟件錯誤準備/執行查詢過程中查詢無效。在網頁上向用戶顯示完整的查詢。希望用用戶常見消息替換系統生成的消息。DBD :: Oracle :: st執行失敗:系統生成消息

例如:

軟件錯誤:

DBD::Oracle::st execute failed: ORA-01722: invalid number (DBD ERROR: error possibly near <> indicator at char 136 in 'SELECT EQUIPID, EQUIPSHORTNAME, MAXLIMITEDDAYS, STATUS, EQUIPNAME FROM LAB_EQUIPMENT_DETAILS WHERE CATEGORYID = '3' AND SUBCATEGORYID = <>' ' AND STATUS != 'DELETE'') [for Statement "SELECT EQUIPID, EQUIPSHORTNAME, MAXLIMITEDDAYS, STATUS, EQUIPNAME FROM LAB_EQUIPMENT_DETAILS WHERE CATEGORYID = '3' AND SUBCATEGORYID = '****' AND STATUS != 'DELETE'"] at /proj/aa/bb/Source/Global_Routines_general_apps.pm line 126.

For help, please send mail to the webmaster ([...]), giving this error message and the time and date of the error.

誰能幫我做這個。

在此先感謝。

回答

0

只需將你的execute語句包裝在一個eval塊中並捕獲錯誤。

eval { 
$sth->execute(); 
... 
}; 
if ([email protected]) { 
# log the full error message 
write_log($sth->errstr); 

# and re-throw the common message 
die 'HEY!!!! Something is messed up here!'; 
} 
相關問題