Skip to end of metadata
Go to start of metadata


This chapter describes and summarizes frequently occurring errors identified with SQLCODE and sqlca.sqlerrm.sqlerrmc. There can be two SQLCODEs for the same sqlca.sqlerrm.sqlerrmc. This is because it may be different depending on the location of the module in which the error occurred among the ALTIBASE internal modules. Since the contents of the error are the same, the corrective actions are the same as well.

Connection does not exist. (SQLCODE=–2)

This is the case that the connection object to be used does not exist or disappears during the query processing process. Check whether the connection has been properly processed and in the case of a threaded program, check whether the connection name is properly indicated in the EXEC SQL AT clause.

String data right truncated. (SQLCODE=1)

This is the case when the length of the declared variable is small in the process of storing the value in the variable from the DB. Change the length of the DB variable as large as (data length + 1byte).

Invalid size of data to bind to a host variable [ Column ID = <A%d>, Data Size = <B%d> , Declared Size of Host Variable = <C%d> ] (SQLCODE=-201144 or -266423)

The actual data of (A+1)-th  column has the size of B, but the length of the host variable has the size of C. so it occurs when the data value exceeds the length of the variable. Therefore, the length of the variable must be set larger than the length of the data. From time to time, even if the memory of the host variable is broken due to a program error. Therefore, it is recommended to check whether the host variable's memset or memory is broken. Or, in the case of a threaded program, it can also occur when concurrency control is not properly controlled with a single connection for multiple SQL statements.

Calculation stack overflow (SQLCODE=-135187 or -659475)

This is the case when the size of the stack used in the query process is exceeded. 
Execute the SQL statement as follows before executing the query. The default is 1024.

 

Value overflow or Numeric value out of range (SQLCODE=-135184 or -659472 or -331890)

This is the case when the data value used in the host variable is an input that is larger than the expression range of the column defined in the actual DB.
Check the data value and change the column if necessary.

Conversion not applicable (SQLCODE=-135180 or -659468)

This is the case when conversion between the data type of the column used in ALTIBASe or the type of host variable is not supported.

 

Additionally, an error may occur when a host variable having a data type that cannot be converted is used in CLOB/BLOB handling

Invalid length of the data type (SQLCODE=-135181 or -659469)

This is the case when data larger than the length that can be stored in the DB column is input.

 

Invalid character value for cast specification (SQLCODE=-331893)

This is the case when a string is contained in a numeric host variable and processed.
Declare a host variable suitable for the column type.

Invalid cursor state. (SQLCODE=-331822) or Function sequence error (SQLCODE= -331796)

This is the case when the order to be followed to use the cursor is not performed properly. Or, this error also occurs when a cursor that has already read all data or a cursor that has been closed and calls to fetch again.

The cursor must be opened for fetch (SQLCODE=-1) or The cursor does not exist (SQLCODE=-589857)

To use a cursor normally, it must be processed with the order of PREPARE -> DECLARE -> OPEN -> FETCH -> CLOSE. This error occurs when an attempt is made to FETCH a cursor that is not normally DECLARE/OPEN.

Not enough insert values (SQLCODE=-200787)

This error occurs when the number of columns specified in the INSERT statement and the number of host variables does not match.

The tablespace does not have enough free space (SQLCODE=-69685 or -69923)

This is the case when there is no space due to the use of all the tablespace capacity during the transaction.

In this case, in the case of the disk tablespace, space must be secured by adding a data file, and in the case of a memory tablespace, available space must be secured by deleting or compacting unnecessary data.

 

Input literal is not long enough for date format. (SQLCODE=-135218)

This is the case when the string entered into the date function is too short.
Check if there are no errors in the entered data.

 


Literals in the input do not match format string. (SQLCODE=-135224)

This is the case when the date string entered in the data function and the date format do not match.

The transaction is already active. (SQLCODE=-266311 or -266312)

Commit-mode can be adjusted for each session. In this process, this occurs when a transaction that has not been committed/rolled back exists and changes to Auto-Commit. Therefore, if an error occurs in the process of changing the properties of a session, first check whether a previously occurred transaction exists.
Or, change the session properties after executing Commit/Rollback. Occasionally, in the case of implementing and using a thread program and a connection pool, it may occur when user management for the connection object (ie, when AutoCommit/NonAutoCommit is used in combination) is careless.

The row already exists in a unique index. (SQLCODE=-69720)

This is the case when the value accessed or changed in the INSERT or UPDATE statement already exists in the primary key or unique index. In this case, check whether the corresponding data value already exists with an inquiry.

Unable to insert (or update) NULL into NOT NULL column. (SQLCODE=- 200790)

This is the case when the column is NOT NULL among the data values entered in the INSERT or UPDATE statement, and a NULL value is attempted to be inserted. Tract data values to prevent NULL data from occurring, or change the NOT NULL Constraints of the column properly.

Indicator variable required but not supplied. (SQLCODE=-331841 or -594101 or 594103)

This case is when the value contained in the host variable from the DB is NULL. This error is returned as SQL_SUCCESS_WITH_INFO. That is, it is an error that recognizes that the passed part is NULL. (There is no guarantee that the actual variable will contain any value.)

To solve this error, it can be solved by performing NVL processing on the column or using a separate int type indicator variable for host variables. Alternatively, the -unsafe_null option can be used among the apre options.

 


Client's query exceeded in the execution time limitation. (SQLCODE=-4164)

If the time for executing a query exceeds the specified time, this error is returned for the query.

Check the execution plan of the query described in the document and take necessary tuning measures. Or, if it is due to the amount of data to be processed even though proper measures have already been taken, execute the following query.

EXEC SQL ALTER SESSION SET QUERY_TIMEOUT = 0;

If set to "0", execution continues regardless of the timeout setting for query processing. However, if this has been done, it is recommended that the user make a careful decision to change, as it can occupy a large amount of resources until the query is completed.

Communication link failure. (SQLCODE=-331843 or -331855)

This is the case when the connection is disconnected due to a server or network error in the process of processing a query. In this case, first, check whether a log related to timeout is recorded in $ALTIBASE_HOME/trc/altibase_boot.log. Usually, two cases occur.

 

The fetch timeout means that the interval between the DBMS server and the program is limited to 60 seconds. If it exceeds this, the server forcibly disconnects the session.

The UTrans Timeout refers to a case where the interval of time that the user keeps without performing Commit/Rollback after a change transaction occurs is limited to 3600 seconds, and if it exceeds this, the session is disconnected. In both cases, the limit value can be changed as follows.

If it is set to a value of "0", it operates so that the corresponding limit is not applied. However, it is recommended that, as in the case of QUERY_TIMEOUT, the developer must set the above problem at its source, since it will continue to occupy resources within the DBMS, and in some cases, failure can occur as long as the transaction continues.

Network problems such as L4, firewall timeout, etc. may cause the altibase_boot.log to be disconnected without errors. Therefore, the cause must be found with a separate PBT (Problem Tracking) process.

 

  • No labels