繼續上一篇文章的內容
21.Db2中SQLSTATE的代號如何定義?
答:如下
Class Code 00: UnqualifIEd Successful Completion
Class Code 01: Warning
Class Code 02: No Data
Class Code 07: Dynamic SQL Error
Class Code 08: Connection Exception
Class Code 09: Triggered Action Exception
Class Code 0A: Feature Not Supported
Class Code 0E: Invalid Schema Name List Specification
Class Code 0F: Invalid Token
Class Code 0K: Resignal When Handler Not Active
Class Code 20: Case Not Found for Case Statement
Class Code 21: Cardinality Violation
Class Code 22: Data Exception
Class Code 23: Constraint Violation
Class Code 24: Invalid Cursor State
Class Code 25: Invalid Transaction State
Class Code 26: Invalid SQL Statement IdentifIEr
Class Code 27: Triggered Data Change Violation
Class Code 28: Invalid Authorization Specification
Class Code 2D: Invalid Transaction Termination
Class Code 2E: Invalid Connection Name
Class Code 2F: SQL Function Exception
Class Code 34: Invalid Cursor Name
Class Code 38: External Function Exception
Class Code 39: External Function Call Exception
Class Code 3B: Savepoint Exception
Class Code 3C: Ambiguous Cursor Name
Class Code 42: Syntax Error or Access Rule Violation
Class Code 44: WITH CHECK OPTION Violation
Class Code 46: Java Errors
Class Code 51: Invalid Application State
Class Code 54: SQL or Product Limit Exceeded
Class Code 55: Object Not in Prerequisite State
Class Code 56: Miscellaneous SQL or Product Error
Class Code 57: Resource Not Available or Operator Intervention
Class Code 58: System Error
22.如何對當前游標的行數據進行刪除,更新操作?
答:例如 DECLARE THISEMP CURSOR FOR SELECT EMPNO, LASTNAME,
WORKDEPT, JOB
FROM CORPDATA.EMPLOYEE
FOR UPDATE OF JOB ;
open THISEMP ;
…
UPDATE CORPDATA.EMPLOYEE
SET JOB = :NEW-CODE
WHERE