IBM Support

SQL0206N when querying warehouse KSK tables

Troubleshooting


Problem

When running an SQL query on a KSK table in the Warehous database, the error SQL0206N is returned. SQL0206N "" is not valid in the context where it is used. SQLSTATE=42703

Symptom

When running an SQL query on the Warehous database tables with a column name specified in the SQL, the error SQL0206N is returned. For example,



    db2 "select Node from ITMUSER.KSK_database"
    SQL0206N "NODE" is not valid in the context where it is used. SQLSTATE=42703

If you do not specify a column name, the command will work. For example, this command will work:

    db2 "select * from ITMUSER.KSK_database"

Cause

The column names in the warehouse database tables have double quotes as part of the name. The double quotes are not visible, however. In the example above, the column name is "Node", with the double quotes as part of the name.

Resolving The Problem

The column name is case sensitive and must be specified with the double quotes. For example, specify the SQL as followed:



    db2 "select \"Node\" from ITMUSER.KSK_database"

The command specifies the column name as "Node", and the double quotes must be escaped with the forward slash (\).

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Server","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"6.3;7.1","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Document Information

Modified date:
17 June 2018

UID

swg21966459