home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC94656 Status: Closed

FED: DB2LOOK GENERATE INCORRECT FUNCTION MAPPING DDL

product:
DB2 FOR LUW / DB2FORLUW / A50 - DB2
Problem description:
db2look generates incorrect function mapping DDL causes users 
need to refine their db2look output before running it to 
recreate their federated objects. 
 
-- -------------------------------- 
-- DDL Statements for FUNCTION MAPPING 
-- -------------------------------- 
CREATE FUNCTION MAPPING "FM_TO_CHAR" 
   FOR "SYSIBM".TO_CHAR(SYSIBM.TIMESTMP,SYSIBM.VARCHAR) 
   SERVER "SERV1" 
   OPTIONS 
      (REMOTE_NAME  'TO_CHAR' 
      ); 
 
In above DDL, TIMESTMP  should be  TIMESTAMP,   VARCHAR should 
be 
VARCHAR(). 
 
Reproduce: 
 
create wrapper net8; 
create server serv1 type oracle version '11.1' wrapper net8 
options(node '****'); 
create user mapping for <USER NAME> server serv1 
options(remote_authid '<USER ID>',remote_password '<PASSWORD>'); 
CREATE FUNCTION MAPPING FM_TO_CHAR  FOR 
SYSIBM.TO_CHAR(SYSIBM.TIMESTAMP,SYSIBM.VARCHAR()) SERVER serv1 
OPTIONS (REMOTE_NAME'TO_CHAR') ; 
 
 
db2look  -d <db name> -e -fedonly -o db2look.sql 
 
-- -------------------------------- 
-- DDL Statements for FUNCTION MAPPING 
-- -------------------------------- 
CREATE FUNCTION MAPPING "FM_TO_CHAR" 
   FOR "SYSIBM".TO_CHAR(SYSIBM.TIMESTMP,SYSIBM.VARCHAR) 
   SERVER "SERV1" 
   OPTIONS 
      (REMOTE_NAME  'TO_CHAR' 
      ); 
 
 
=> db2 "SELECT substr(funcschema,1,14),substr(funcname,1,40) 
from SYSIBM.SYSFUNCMAPPINGS" 
 
1              2 
-------------- ---------------------------------------- 
SYSIBM         TO_CHAR(SYSIBM.TIMESTMP,SYSIBM.VARCHAR) 
 
  1 record(s) selected. 
 
 
=> db2 "CREATE FUNCTION MAPPING "FM_TO_CHAR" FOR 
"SYSIBM".TO_CHAR(SYSIBM.TIMESTMP,SYSIBM.VARCHAR) SERVER "SERV1" 
OPTIONS (REMOTE_NAME'TO_CHAR') " 
DB21034E  The command was processed as an SQL statement because 
it was not a 
valid Command Line Processor command.  During SQL processing it 
returned: 
SQL0104N  An unexpected token "VARCHAR" was found following 
"IBM.TIMESTMP, 
SYSIBM.".  Expected tokens may include:  "LONG".  LINE NUMBER=1. 
SQLSTATE=42601 
 
 
=> db2 "CREATE FUNCTION MAPPING "FM_TO_CHAR" FOR 
"SYSIBM".TO_CHAR(SYSIBM.TIMESTMP,SYSIBM.VARCHAR()) SERVER 
"SERV1" OPTIONS (REMOTE_NAME'TO_CHAR') " 
DB21034E  The command was processed as an SQL statement because 
it was not a 
valid Command Line Processor command.  During SQL processing it 
returned: 
SQL0204N  "SYSIBM.TIMESTMP" is an undefined name.  LINE 
NUMBER=2. 
SQLSTATE=42704 
 
=> db2 "CREATE FUNCTION MAPPING "FM_TO_CHAR" FOR 
"SYSIBM".TO_CHAR(SYSIBM.TIMESTAMP,SYSIBM.VARCHAR()) SERVER 
"SERV1" OPTIONS (REMOTE_NAME'TO_CHAR') " 
DB20000I  The SQL command completed successfully.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All users                                                    * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Please upgrade to DB2 version 10.5 fixpack 3 or later        * 
****************************************************************
Local Fix:
Replace TIMESTMP with TIMESTAMP, VARCHAR with VARCHAR() in 
db2look function mapping output
available fix packs:
DB2 Cancun Release 10.5.0.4 (also known as Fix Pack 4) for Linux, UNIX, and Windows
DB2 Version 10.5 Fix Pack 9 for Linux, UNIX, and Windows

Solution
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
05.08.2013
28.11.2014
28.11.2014
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.5.0.4 FixList