14. 전처리 오류 코드/메시지#
전처리 오류#
전처리 과정에서 발생하는 오류 메시지의 형식에 대해서 설명한다.
오류 출력 형식#
[ERR-<error code> : <error message>]
File : <file name>
Line : <line number>
Offset : <n-m>
Error_token : <error token>
- <error code>: 발생한 오류 코드
- <error message>: 오류 메시지
- <file name>: 오류가 발생한 파일의 이름
- <line number>: 오류가 발생한 행 번호
- <n-m>: 오류가 발생한 열 위치
- <error token>: 오류가 발생한 토큰
예제#
다음 예제는 EXEC SQL END DECLARE SECTION이 없을 경우의 오류 출력을 보여준다.
[ERR-302L : EXEC SQL END DECLARE SECTION is not exist.]
File : tmp.sc
Line : 4
Offset: 1-31
Error_token:EXEC SQL BEGIN DECLARE SECTION;
오류 코드 형식#
전처리 과정에서 발생하는 오류 코드체계는 다음과 같다.
ERR-xxxY
- xxx: 오류 번호
- Y: 오류 분류
오류 번호#
오류 종류에 따라 다음과 같은 범위로 오류 번호가 분류된다.
- 101 – 199 : 시스템 오류
- 201 – 299 : 호스트 변수 관련 오류
- 301 – 399 : 커서 관련 오류
- 401 – 499 : 일반 오류
- 701 – 799 : 현재 버전에서 지원하지 않는 기능
오류 분류#
오류 분류는 오류가 어떤 전처리 과정에서 발생한 것인지를 나타낸다.
- E: 호스트 변수 선언부에서 오류가 발생한 경우
- L: 내장 SQL문 처리부에서 오류가 발생한 경우
- M: 매크로 처리 부분에서 오류가 발생한 경우
- H: 위 경우를 제외한 처리부에서 오류가 발생한 경우
오류 코드/메시지#
101H – 199H#
| 오류 코드 | 에러 메시지 |
|---|---|
| 101H | File '<file name>' open error. |
| 102H | FileSize(<file name>) is zero. |
| 103H | The include file [<file name>] does not exist in the folder. |
| 104H | File '<file name>' delete error. |
| 105H | Memory allocation error. |
| 106H | Latch initialize error. (<file name>:<line>) |
| 107H | Latch read error. (<file name>:<line>) |
| 108H | Latch release error. (<file name>:<line>) |
| 109H | Latch write error. (<file name>:<line>) |
| 110H | Latch destroy error. (<file name>:<line>) |
| 111H | File close error. |
| 112H | File <file name> write error. |
201E – 299E#
| 오류 코드 | 에러 메시지 |
|---|---|
| 201E | C-type Comment is not closed. |
| 202E | The structure name <name> is unknown. |
| 203E | The structure name <name> is a duplicate. |
| 204E | The symbol name <name> cannot be added to the symbol table. |
| 205E | The symbol name exceeds the maximum length. [<name>] |
| 206E | Redefinition of '<name>'. |
| 207E | Unknown type '<name>'. |
| 208E | Invalid scope depth [<depth>]. |
| 209E | Inconsistent brace count. |
| 210E | Inconsistent parenthesis count error. |
| 211E | The nested structure exceeds the maximum possible depth. |
| 212E | VARCHAR declarations are not permitted in #include files. |
301L – 399L#
| 오류 코드 | 에러 메시지 |
|---|---|
| 301L | The C include file can't contain embedded SQL statements. |
| 302L | EXEC SQL END DECLARE SECTION does not exist. |
| 303L | EXEC SQL BEGIN DECLARE SECTION does not exist. |
| 304L | EXEC SQL END ARGUMENT SECTION does not exist. |
| 305L | EXEC SQL BEGIN ARGUMENT SECTION does not exist. |
| 306L | Unterminated string error. |
| 307L | The connection name [<name>] is too long. (max length is 50) |
| 308L | The cursor name [<name>] is too long. (max length is 50) |
| 309L | Statement name [<name>] is too long. (max length is 50) |
| 310L | The number of FOR loop iterations must be greater than zero. |
| 311L | The host variable [<name>] is unknown. |
| 312L | The host variable in a FREE LOB statement must be a LOB locator. |
| 313L | Unterminated embedded SQL statement. |
| 314L | The indicator variable [<name>] should be of type SQLLEN or a compatible type. |
| 315L | Two or more arrays of structures are bound to host variables in the same statement. |
401M – 499M#
| 오류 코드 | 에러 메시지 |
|---|---|
| 401M | An unknown macro is too long. (>2k) |
| 402M | Macro #if statement syntax error |
| 403M | Macro #elif statement syntax error |
| 404M | Macro #elif statement sequence error |
| 405M | Macro #else statement sequence error |
| 406M | Macro #endif statement sequence error |
| 407M | An empty char constant cannot be used with an #if macro expression. |
| 408M | Include files are nested too deeply. (maximum <0%s>) |
| 409M | No #endif error. |
| 410M | A closing parenthesis ')' is missing from the macro parameter list. |
| 411M | Unknown macro name, or missing parenthesis after macro name. (<0%s>) |
| 412M | Unterminated string error. |
501H – 599H#
| 오류 코드 | 에러 메시지 |
|---|---|
| 501H | <option name> option is repeated |
| 502H | Option string <option string> is too long. |
| 503H | The -mt and -sea options cannot be used together. |
| 504H | Input file must be a form of '*.sc'. |
| 505H | Unknown embedded SQL statement type. |
701L – 799L#
| 오류 코드 | 에러 메시지 |
|---|---|
| 701L | No CURSOR SENSITIVITY options are supported yet. |
| 702L | No CURSOR INSENSITIVITY options are supported yet. |
| 703L | No CURSOR ASENSITIVITY options are supported yet. |
| 704L | WITH HOLD option is not supported yet. |
| 705L | WITH RETURN option is not supported yet. |
| 706L | READ ONLY option does is supported yet. |
| 707L | ALTER COMPACT option is not supported yet. |