IBM Support

ANR9999D_3831306406 SQL20521N  Reason code=" 7".  SQLSTATE=428HV

Troubleshooting


Problem

A select statement is issued from the server and returns the following error: ANR9999D_3831306406 ReportSQLDiagInfo(dbieval.c:1572) Thread<1317544>: Missing sqlState=428HV,sqlCode=-20521

Cause

There is a problem with the SQL syntax/structure

Environment

Tivoli Storage Manager Server on Linux, Unix, Windows

Diagnosing The Problem

02/23/2015 11:55:25 ANR9999D_3831306406 ReportSQLDiagInfo(dbieval.c:1572) Thread<1317544>: Missing sqlState=428HV, sqlCode=-20521 from table. Returning rc = 9994. (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> issued message 9999 from: (SESSION: 318290) 02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00000000ec8ff3 OutDiagToCons (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00000000ecbfe1 outDiagfExt (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00000000b94cf6 DbiEvalSQLOutcomeX (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00000000c0369b tbSQLExecuteSelect (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x000000005d37ad NewAdmSQLExecute (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x000000005d5b03 AdmSQLExecute (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x000000004fa2ef AdmCommandLocal (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x000000004fbbdc admCommand (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00000000c2e05a SmAdminCommandThread (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00000000f6c3cf StartThread (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x00003826a079d1 *UNKNOWN* (SESSION: 318290)
02/23/2015 11:55:25 ANR9999D Thread<1317544> 0x000038266e89dd *UNKNOWN* (SESSION:
02/23/2015 11:55:25 ANR0162W Supplemental database diagnostic information: -1:428HV:-20521 ([IBM][CLI Driver] [DB2/LINUXX8664]
SQL20521N Error occurred processing a conditional compilation directive near "_". Reason code=" 7".
SQLSTATE=428HV). (SESSION: 318290)

The error:     SQL20521N  Error occurred processing a conditional compilation directive near "_". Reason code=" 7".  SQLSTATE=428HV). (SESSION:                    

Reason code:
   7  A conditional compilation directive was specified in a context where conditional compilation directives are not supported.

User Response:
   7  Ensure that the context in which the compilation directive is used is valid. Valid contexts include: SQL procedure definitions, compiled SQL function definitions, compiled trigger definitions, and PL/SQL package definitions.



Resolving The Problem

As an example the following Select was issued which caused the problem:


select schedule_name,_completed from events where completed>='2015-02-22 08:00' and
completed<'2015-02-23 08:00' and result=8 and schedule_name like 'DLY-BKP-ADC-DM%' order by schedule_name asc

The SQL2052N message indicates the problem is near "<string>". Look at the Select and find the string that is indicated by this message. This will be the problematic part of the select statement.

In this example it is near an underscore character "_".
SQL20521N  Error occurred processing a conditional compilation directive near "_". Reason code="7".
The underscore in the Select is:
_completed

The column name in the events table is "completed". The "_" in this case is a typographical error which created the SQL20521N condition.

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Server","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF025","label":"Platform Independent"},{"code":"PF033","label":"Windows"}],"Version":"All Supported Versions","Edition":"All Editions","Line of Business":{"code":"LOB26","label":"Storage"}}]

Product Synonym

TSM ADSM ITSM IBM Spectrum Protect

Document Information

Modified date:
17 June 2018

UID

swg21697756