Previous Topic: SQLCA in C LanguageNext Topic: SQL States Table


SQL State Classes

The two-character SQLSTATE classes, listed in the following table, are the first (left-most) characters of the SQLSTATE. You can extract these classes from SQLSTATEs returned by CA Datacom and use the error-class-sensitive criteria thus obtained for error recovery purposes. For a table listing the SQLSTATEs in numerical order and the SQL return code(s) that equate to them, see SQL States Table.

Be aware that some classes shown in the following table may not yet have had associated error conditions defined for them by CA Datacom. Also, we reserve the right to add or drop classes and to move existing error conditions between classes and subclasses (the right-most 3 bytes) at any time, thereby changing the SQLSTATE associated with an error condition. However, such changes are expected to only rarely occur.

Class

Description

00

Successful completion.

01

Warning (completion condition as opposed to exception condition).

02

No data (completion condition as opposed to exception condition).

03

SQL statement not yet complete.

07

Dynamic SQL error.

08

Connection exception.

09

Triggered action exception.

0A

Feature not supported.

0B

Invalid transaction initiation.

0D

Invalid target type specification.

0F

Locator exception.

0L

Invalid grantor.

0P

Invalid role specification.

OW

Prohibited stmt encountered during trigger exec.

21

Cardinality violation.

22

Data exception.

23

Integrity constraint violation.

24

Invalid cursor state.

25

Invalid transaction state.

26

Invalid SQL statement name.

27

Triggered data change violation.

28

Invalid authorization specification.

2B

Dependent privilege descriptors still exist.

2D

Invalid transaction termination.

2E

Invalid connection name.

2F

SQL routine exception.

30

Invalid SQL statement.

31

Invalid target specification value.

33

Invalid SQL descriptor name.

34

Invalid cursor name.

35

Invalid condition number.

36

Cursor sensitivity exception.

38

External routine exception.

39

External routine invocation exception.

3B

Savepoint exception.

3C

Ambiguous cursor name.

3D

Invalid catalog name.

3F

Invalid schema name.

40

Transaction rollback.

42

Syntax error or access rule violation.

44

WITH CHECK option violation.

51

Application state is invalid.

53

Inconsistent specification or invalid operand.

54

SQL or DATACOM limit exceeded.

55

Object not in prerequisite state.

56

Miscellaneous SQL or DATACOM error.

57

Resource unavailable or operator intervened.

58

System error.

80

CA Datacom Datadictionary, DDD, and CXX errors.

Hx

WHERE x=1 thru F (H1 thru HF): SQL Multimedia (various subclasses).

HZ

Remote Database Access (various subclasses).

Re

SQLCODE -118, where the e is the first character of the CA Datacom/DB return code.

Se

SQLCODE -117, where the e is the first character of the CA Datacom/DB return code.