DB2 - Problem description
Problem IC95400 | Status: Closed |
RECEIVE SQL1822N/SQL0401N ERROR WHEN QUERYING A NICKNAME IN AN ORA MODE DATABASE | |
product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problem description: | |
The problem happens when the federated database is a ORA compatibility database while the data source is not. The error happens because a remote statement like below is pushed down to data source even though COLUMN1's data type is DATE in the remote database: CAST(:H0 AS TIMESTAMP) <= B0."COLUMN1" The problem can be reproduced as: SET PASSTHRU OS400SERV; DROP TABLE TEST; CREATE TABLE TEST(C1 INT, C2 DATE); SET PASSTHRU RESET; CREATE NICKNAME NICK1 FOR OS400SERV."MYSCHEMA"."TEST"; CREATE PROCEDURE TEST1 (OUT pC1 INT) SPECIFIC TEST1 LANGUAGE SQL BEGIN DECLARE VC2 VARCHAR(10) DEFAULT '2013-07-05';-- SELECT COUNT(C1) INTO pC1 FROM NICK1 where C2>=VC2;-- END ; db2 => call test1(?) SQL1822N Unexpected error code "-401" received from data source "OS400SERV". Associated text and tokens are " SQL0401N The data types of the operands for the opera". SQLSTATE=560BD | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * The users are querying a nickname on Ora mode database. * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Update to 10.5.0.3 * **************************************************************** | |
Local Fix: | |
Modify your application or procedure, declare the host variable with type of DATE instead of VARCAHR/CHAR: CREATE PROCEDURE TEST1 (OUT pC1 INT) SPECIFIC TEST1 LANGUAGE SQL BEGIN DECLARE VC2 DATE DEFAULT '2013-07-05';-- SELECT COUNT(C1) INTO pC1 FROM NICK1 where C2>=VC2;-- END | |
available fix packs: | |
DB2 Version 10.5 Fix Pack 3 for Linux, UNIX, and Windows | |
Solution | |
Problem Fixed In 10.5.0.3 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 27.08.2013 03.03.2014 03.03.2014 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.5.0.3 | |
10.5.0.3 |