Db2 Sql Errors

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Db2 Sql Errors as PDF for free.

More details

  • Words: 240,071
  • Pages: 574
®

®

IBM DB2 Universal Database



Message Reference Volume 2 Version 7

GC09-2979-00

®

®

IBM DB2 Universal Database



Message Reference Volume 2 Version 7

GC09-2979-00

Before using this information and the product it supports, be sure to read the general information under “Appendix C. Notices” on page 555.

This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. Order publications through your IBM representative or the IBM branch office serving your locality or by calling 1-800-879-2755 in the United States or 1-800-IBM-4YOU in Canada. When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1993, 2000. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents About This Guide . . . . Who Should Use This Guide . How This Guide Is Structured Organization . . . . . Conventions . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

v v v v v

Chapter 1. Introduction to Messages . . . 1 Information Available Online. . . . . . . 1 Other DB2 Messages . . . . . . . . 3 Other Message Sources. . . . . . . . 3 Chapter 2. SQL Messages . . . . . . . 5 SQL0000 - SQL0099 . . . . . . . . . . 5 SQL0100 - SQL0199 . . . . . . . . . 15 SQL0200 - SQL0299 . . . . . . . . . 32 SQL0300 - SQL0399 . . . . . . . . . 51 SQL0400 - SQL0499 . . . . . . . . . 64 SQL0500 - SQL0599 . . . . . . . . . 90 SQL0600 - SQL0699 . . . . . . . . . 110 SQL0700 - SQL0799 . . . . . . . . . 123 SQL0800 - SQL0899 . . . . . . . . . 128 SQL0900 - SQL0999 . . . . . . . . . 136 SQL1000 - SQL1099 . . . . . . . . . 154 SQL1100 - SQL1199 . . . . . . . . . 175 SQL1200 - SQL1299 . . . . . . . . . 188 SQL1300 - SQL1399 . . . . . . . . . 208 SQL1400 - SQL1499 . . . . . . . . . 222 SQL1500 - SQL1599 . . . . . . . . . 234 SQL1600 - SQL1699 . . . . . . . . . 239 SQL1700 - SQL1799 . . . . . . . . . 246 SQL1800 - SQL1899 . . . . . . . . . 252 SQL1900 - SQL1999 . . . . . . . . . 257 SQL2000 - SQL2099 . . . . . . . . . 257 SQL2100 - SQL2199 . . . . . . . . . 268 SQL2200 - SQL2299 . . . . . . . . . 269 SQL2300 - SQL2399 . . . . . . . . . 272 SQL2400 - SQL2499 . . . . . . . . . 275 SQL2500 - SQL2599 . . . . . . . . . 278 SQL2600 - SQL2699 . . . . . . . . . 290 SQL2700 - SQL2799 . . . . . . . . . 292 SQL2800 - SQL2899 . . . . . . . . . 300 SQL3000 - SQL3099 . . . . . . . . . 303 SQL3100 - SQL3199 . . . . . . . . . 318 SQL3200 - SQL3299 . . . . . . . . . 334 SQL3300 - SQL3399 . . . . . . . . . 342 © Copyright IBM Corp. 1993, 2000

SQL3400 - SQL3499 . SQL3500 - SQL3599 . SQL3600 - SQL3699 . SQL3700 - SQL3799 . SQL3800 - SQL3899 . SQL3900 - SQL3999 . SQL4000 - SQL4099 . SQL4100 - SQL4199 . SQL4300 - SQL4399 . SQL4400 - SQL4499 . SQL4900 - SQL4999 . SQL5000 - SQL5099 . SQL5100 - SQL5199 . SQL6000 - SQL6099 . SQL6100 - SQL6199 . SQL6500 - SQL6599 . SQL7000 - SQL7099 . SQL8000 - SQL8099 . SQL8100 - SQL8199 . SQL9300 - SQL9399 . SQL10000 - SQL10099 SQL20000 - SQL20099 SQL20100 - SQL20199 SQL20200 - SQL20299 SQL29000 - SQL29100 SQL30000 - SQL30099 SQL30100 - SQL30199

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

348 351 359 361 363 364 370 373 382 384 386 394 400 406 423 425 434 437 441 442 443 447 469 472 473 476 489

Chapter 3. SQLSTATE Messages . . . . 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 0D Invalid Target Type Specification . . . . . . . . . . . Class Code 0F Invalid Token . . . . . . Class Code 0K Invalid RESIGNAL statement Class Code 20 Case Not Found for Case Statement . . . . . . . . . . . . Class Code 21 Cardinality Violation . . . . Class Code 22 Data Exception. . . . . .

491 492 492 495 496 496 496 497 497 497 497 497 498 498

iii

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 28 Invalid Authorization Specification . . . . . . . . . . . Class Code 2D Invalid Transaction Termination . . . . . . . . . . . . Class Code 2E Invalid Connection Name . . Class Code 34 Invalid Cursor Name . . . Class Code 38 External Function Exception Class Code 39 External Function Call Exception . . . . . . . . . . . . Class Code 3B Invalid SAVEPOINT . . . . Class Code 40 Transaction Rollback . . . . Class Code 42 Syntax Error or Access Rule Violation . . . . . . . . . . . . . Class Code 44 WITH CHECK OPTION Violation . . . . . . . . . . . . . Class Code 46 Java DDL . . . . . . . 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 . . . . . . . .

iv

Message Reference, Volume 2

499 500 500 501 501 501 501 502 502 503 503 504 504 515 515 516 516 518 519 519

Class Code 58 System Error .

.

.

.

.

. 521

Appendix A. Communications Errors . . 523 TCP/IP . . . . . . . . . . . . . 523 APPC . . . . . . . . . . . . . . 527 NETBIOS . . . . . . . . . . . . 529 IPX/SPX . . . . . . . . . . . . . 531 Appendix B. Using the DB2 Library DB2 PDF Files and Printed Books . DB2 Information . . . . . . Printing the PDF Books . . . . Ordering the Printed Books . . DB2 Online Documentation . . . Accessing Online Help . . . . Viewing Information Online . . Using DB2 Wizards . . . . . Setting Up a Document Server . Searching Information Online . .

. . . 537 . . . 537 . . . 537 . . . 546 . . . 547 . . . 548 . . . 548 . . . 550 . . . 552 . . . 553 . . . 554

Appendix C. Notices . . . . . . . . 555 Trademarks . . . . . . . . . . . . 558 Index

.

.

.

.

.

.

.

.

.

.

.

.

. 561

Contacting IBM . . . . . . . . . . 563 Product Information . . . . . . . . . 563

About This Guide The purpose of this book is to list the messages returned by various components of DB2.

Who Should Use This Guide The Message Reference is designed to be used by anyone using DB2 and requiring more detailed information about returned messages.

How This Guide Is Structured This guide lists all the possible error messages returned by the various components of DB2.

Organization This book contains the following sections: v Chapter 1. Introduction to Messages, describes how to access and interpret error messages. v Chapter 2. SQL Messages, describes the messages (SQLCODE values) generated by the database manager when a warning or error condition is detected. v Chapter 3. SQLSTATE Messages, describes the meaning of each SQLSTATE value. v Appendix A. Communications Errors, describes communications error codes associated with sqlcode -30081.

Conventions The format for date and time, and the characters used as separators for date and time, are intended for a system configured to use the United States national language format. These may be different on your display, depending on the national language format used by your system.

© Copyright IBM Corp. 1993, 2000

v

vi

Message Reference, Volume 2

Chapter 1. Introduction to Messages It is assumed that you are familiar with the functions of the operating system where DB2 is installed. You can use the information contained in the following chapters to identify an error or problem and resolve the problem by using the appropriate recovery action. This information can also be used to understand where messages are generated and logged.

Information Available Online The following DB2 messages are accessible from the operating system command line: Prefix Description ASN

messages generated by DB2 Replication

CCA

messages generated by the Client Configuration Assistant

CLI

messages generated by Call Level Interface

DBA

messages generated by the Control Center and the Database Administration Utility

DBI

messages generated by installation and configuration

DB2

messages generated by the command line processor

DWC

messages generated by the Data Warehouse Center

FLG

messages and reason codes generated by the Information Catalog Manager

GSE

messages generated by the DB2 Spatial Extender

SAT

messages generated by DB2 Satellite Edition

SPM

messages generated by the sync point manager

SQJ

messages generated by Embedded SQL in Java (SQLJ)

SQL

messages generated by the database manager when a warning or error condition has been detected.

As well, the message text associated with SQLSTATE values is available on-line. Message identifiers consist of a three character message prefix (see above list), followed by a four or five digit message number. The single digit letter at the end which describes the severity of the error message is optional. © Copyright IBM Corp. 1993, 2000

1

To access help on these error messages, enter the following at the operating system command prompt: db2 “? XXXnnnnn” where XXX represents the message prefix and where nnnnn represents the message number.

Note: The message identifier accepted as a parameter of the db2 command is not case sensitive, and the terminating letter is not required. Therefore, the following commands will produce the same result: v db2 “? SQL0000N” v db2 “? sql0000” v db2 “? SQL0000n” If the message text is too long for your screen, use the following command (on unix-based systems and others which support ’more’): db2 “? XXXnnnnn” | more

Help can also invoked in the interactive input mode. To enter the interactive input mode, enter the following at the operating system command prompt: db2

Once in the interactive input mode, you can enter commands at the following command prompt: db2 =>

To get DB2 message help in this mode, type the following at the command prompt: ? XXXnnnnn

Note: If the message text exceeds the length of the screen, users with non-graphical workstations can pipe the output to the ’more’ (on unix-based systems) program or redirect the output to a file which can then be browsed. The message text associated with a given SQLSTATE value can be retrieved by issuing:

2

Message Reference, Volume 2

db2 “? nnnnn” or db2 “? nn”

where nnnnn is a five digit SQLSTATE (alphanumeric) and nn is the two digit SQLSTATE class code (first two digits of the SQLSTATE value).

Other DB2 Messages Some DB2 components return messages that are not described in this manual, or online. Some of the message prefixes may include: AUD

messages generated by the DB2 Audit facility.

DIA

diagnostics messages generated by many DB2 components. These messages are written in the diagnostics log file db2diag.log, and are intended to provide additional information for users and DB2 service personnel when investigating errors.

GOV

messages generated by the DB2 governor utility.

In most cases, these messages provide sufficient information to determine the cause of the warning or error. For more information on the command or utility that generated the messages, please refer to the appropriate manual where the command or utility is documented.

Other Message Sources When running other programs on the system, you may receive messages with prefixes other than those mentioned in this reference. For information on these messages, refer to the publications that you received for that program product.

Chapter 1. Introduction To Messages

3

4

Message Reference, Volume 2

Chapter 2. SQL Messages Each message has a message identifier that consists of a prefix (SQL) and a message number. Messages are listed in numeric sequence based upon the message number. There are three message types: notification, warning, and critical. Message identifiers ending with an N are error messages. Those ending with a W indicate warning or informational messages. Message identifiers ending with a C indicate critical system errors. The message number is also referred to as the SQLCODE. The SQLCODE is passed to the application as a positive or negative number, depending on its message type (N, W, or C). N and C yield negative values whereas W yields a positive value. DB2 returns the SQLCODE to the application and the application can get the message associated with the SQLCODE. DB2 also returns an SQLSTATE value for conditions that could be the result of an SQL statement. SQLSTATE values are listed in Chapter 3. SQLSTATE Messages. Some SQLCODE values have associated SQLSTATE values. SQLSTATE values associated with a given SQLCODE (if applicable) have been documented with each message in this chapter. Variable parameters for SQL messages are shown as descriptive names.

SQL0000 - SQL0099 SQL0000W

Statement processing was successful.

SQL0001N

Binding or precompilation did not complete successfully.

Explanation: The SQL statement executed successfully, unless a warning condition occurred.

Explanation: For reasons specified in the previous messages, the bind or precompile request was unsuccessful.

User Response: Check SQLWARN0 to ensure that it is blank. If it is blank, the statement executed successfully. If it is not blank, a warning condition exists. Check the other warning indicators to determine the particular warning condition. For example, if SQLWARN1 is not blank, a string was truncated.

No package is created.

Refer to the Application Development Guide.

SQL0002N

sqlcode: 0

Explanation: For reasons specified in the previous messages, the bind file name cannot be used as specified.

sqlstate: 00000, 01003, 01004, 01503, 01504, 01506, 1509, 01517

© Copyright IBM Corp. 1993, 2000

User Response: Refer to the messages in the message file. Resubmit the command. If installing the sample database, drop it and install the sample database again. The bind file name is not valid.

5

No package is created. User Response: Refer to the messages in the message file. Resubmit the command. If installing the sample database, drop it and install the sample database again. SQL0003N

The database name is not valid.

Explanation: For reasons specified in the previous messages, the database name cannot be used as specified. No package is created. User Response: Refer to the messages in the message file. Resubmit the command. SQL0004N

The password is not valid.

Explanation: The password contains characters that are not valid or the password is too long. No package is created. User Response: Resubmit the command with a valid password. SQL0005N

The message file name is not valid.

Explanation: For reasons specified in the previous messages, the message file name cannot be used as specified. No package is created. User Response: Refer to the messages in the message file. Check the name of the message file. Check the attributes of the message file if it exists. Resubmit the command. SQL0006N

The datetime format parameter is not valid.

Explanation: The value of the datetime format parameter is not in the valid range of 0 through 3. No package is created. User Response: Resubmit the command with a valid format parameter.

6

Message Reference, Volume 2

SQL0007N

The character “” following “” is not valid.

Explanation: The specified “” is not a valid character in SQL statements. The “” field indicates the 20 characters of the SQL statement that preceded the character that is not valid. Federated system users: some data sources do not provide the appropriate values for the “” and “” message tokens. In these cases, “” and “” will have the following format: “:UNKNOWN”, indicating that the actual values for the specified data source are unknown. The statement cannot be processed. User Response: Remove or replace the character that is not valid. sqlcode: -7 sqlstate: 42601 SQL0008N

The token “” found in a host variable declaration is not valid.

Explanation: A host variable declaration has invalid syntax. The precompiler cannot identify the host variable. The statement cannot be processed. None of the host variables declared in the statement (up to the semicolon) are accepted. User Response: Examine the syntax of the host variable declaration. SQL0009W

An attempt to override a precompiler option was ignored.

Explanation: An attempt was made to override a precompiler option. The option is ignored. User Response: Ensure that all precompiler options are specified correctly.

SQL0010N

The string constant beginning with “<string>” does not have an ending string delimiter.

Explanation: The statement contains a string constant, beginning with “<string>”, that is not terminated properly. The statement cannot be processed. User Response: Examine the statement for missing apostrophes in the indicated string constant. sqlcode: -10

The comment is not terminated.

Explanation: The comment is not terminated properly. The statement cannot be processed. User Response: Examine the statement for a missing or extra comment delimiter in the indicated comment. SQL0012W

Correlation without qualification has occurred for the column “”.

Explanation: The named column occurs in a SELECT statement, is not explicitly qualified, and occurs in a table specified in the FROM clause of an outer select. Consequently, the reference to the column in the SELECT statement has been taken to be an outer reference and correlation will occur. The statement was processed under the assumption that correlation was intended. User Response: Ensure that correlation was intended. It is a good practice to explicitly qualify intended outer references. sqlcode: +12 sqlstate: 01545

An empty delimited identifier is not valid.

Explanation: During precompilation, either a cursor name, statement name, database name, or authorization ID, specified as an empty string, was found. This is not valid. The statement cannot be processed. User Response: Provide a valid cursor name, statement name, database name, or authorization ID. SQL0014N

sqlstate: 42603 SQL0011N

SQL0013N

The source file name is not valid.

Explanation: The source file name specified in the call to the precompiler contains invalid characters or the pointer to the source file name is invalid. No package was created. User Response: Ensure that the source file name is correct. SQL0015N

The host variable data type ″″ is not valid. Use ″″ instead.

Explanation: If the WCHARTYPE CONVERT precompile option is in effect then the graphic host variable must be declared with the data type ’wchar_t’, not ’sqldbchar’. If the WCHARTYPE NOCONVERT precompile option is in effect (the default) and ’wchar_t’ is defined as a 4-byte integer on this platform, then the graphic host variable must be declared with the data type ’sqldbchar’, not ’wchar_t’. User Response: Replace the current data type of the host variable with the data type specified in the message. SQL0020W

Bind or precompile option(s) “” are not supported by the target database and will be ignored.

Explanation: This warning is returned in the following situations:

Chapter 2. SQL Messages

7

v one or more options that were specified at precompile/bind time are not supported by the target DBMS

33

OWNER

34

QUALIFIER

v the option value(s) of one or more options that were specified at precompile/bind time are not supported by the target DBMS

35

TEXT

40

VALIDATE

41

EXPLAIN

42

ACTION

44

REPLVER

45

RETAIN

Enter ″db2 ? bind″ or ″db2 ? prep″ for a list of which options are supported only by a DRDA application server.

46

RELEASE

47

DEGREE

50

STRDEL

Possible option numbers and their corresponding option names include:

51

DECDEL

55

CHARSUB

56

CCSIDS

57

CCSIDM

58

CCSIDG

59

DEC

60

WCHARTYPE

61

DYNAMICRULES

62

INSERT

63

EXPLSNAP

64

FUNCPATH

65

SQLWARN

66

QUERYOPT

The unsupported options/values will be ignored. The most probable cause is that an option or option value which is only supported while connected to a DRDA application server has been specified while connected to a non-DRDA server.

1

DATETIME

2

LANGLEVEL

4

ISOLATION

5

BLOCKING

6

GRANT

8

SQLFLAG

16

CONNECT

17

SQLRULES

18

DISCONNECT

19

SYNCPOINT

20

ISOLATION

21

BINDFILE

22

SQLCA

23

PACKAGE

24

OPTLEVEL

25

SYNTAX or SQLERROR

26

NOLINEMACRO

30

LEVEL

Explanation: The option specified in the message is not a valid precompiler option.

31

COLLECTION

The option is ignored.

32

VERSION

User Response: Ensure that all precompiler

8

Message Reference, Volume 2

User Response: Ensure the specification of bind or precompile “” was intended while connected to this DBMS. SQL0021W

Invalid precompiler option “