p; 题外话,create public database link otlink connect to system identified by manager using ''''oratest''''; 说回来,以下两个函数: SQLCODE ----Returns the numeric value for the error code. You can assign it to a NUMBER variable. SQLERRM ----Returns character data containing the message associated with the error number. 一般这样, EXCEPTION ... WHEN OTHERS THEN ROLLBACK; v_error_code:=SQLCODE; V_ERROR_MESSAGE:=SQLERRM; INSERT INTO ........ END; 八、调用外围环境 SQLPLUS PROCEDURE BUILDER DEVELOPER 2000 OTHER ......... ---- 也就是把ERROR NUMBER和MESSAGE输出到SCREEN。 九、使用RAISE_APPLICATION_ERROR EXCEPTION WHEN NO_DATA_FOUND THEN RAISE_APPLICATION_ERROR(-20201,''''NO MATCH RECORD YOU WANNA''''); END; 当然,RAISE_APPLICATION_ERRO也是可以放在EXECUTE区的,IF 。。。 THEN RAISE_APPLICATION_ERRO(); END IF; 这也是很好理解。