IBM Support

SE66764 - OSP-DB-OTHER-INCORROUT ALTER COLUMN NORMALIZED CAUSES
TRUNCATION OF DATA

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 APAR (Authorized Program Analysis Report)

Abstract

OSP-DB-OTHER-INCORROUT ALTER COLUMN NORMALIZED CAUSES
TRUNCATION OF DATA

Error Description

When a not normalized UTF-8/1208 field is altered to a          
UTF-16/1200 normalized data type, Data gets lost.              
Table is created with                                          
CREATE TABLE PMR33720.UNICODEDTA (                              
UNITEXT VARCHAR(2048) ALLOCATE(30) CCSID 1208 NOT NULL DEFAULT  
''                                                              
);                                                              
and filled with:                                                
INSERT INTO PMR33720.UNICODEDTA (UNITEXT) VALUES ('123456789'),
('??? ? '), ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('ABC{[]}'),        
('?a?o?A?O');                                                  
                                                               
this statement:                                                
ALTER TABLE PMR33720.UNICODEDTA ALTER COLUMN UNITEXT SET        
DATA TYPE VARGRAPHIC (2048) ALLOCATE (30) CCSID 1200 NORMALIZED
DEFAULT '' NOT NULL ;                                          
will truncate some of the fields by half.                      

Problem Summary

When a column that is a non-normalized UTF-8/1208 field is      
altered to a UTF-16/1200 normalized data type, data can be      
truncated.  For example:                                        
                                                               
CREATE TABLE T1                                                
(COL1 VARCHAR(2048) ALLOCATE(30) CCSID 1208 NOT NULL DEFAULT '')
                                                               
INSERT INTO T1(COL1) VALUES ('123456789')                      
                                                               
ALTER TABLE T1 ALTER COLUMN COL1                                
SET DATA TYPE VARGRAPHIC (2048) ALLOCATE (30) CCSID 1200        
NORMALIZED DEFAULT '' NOT NULL ;                                
                                                               
Data in COL1 is truncated.                                      

Problem Conclusion

Copying the data to the NORMALIZED field is corrected to no    
longer truncate the data.  The ptf is preventative.  To recover
the truncated data, restore from backup.                        

Temporary Fix

Comments

Circumvention


Normalize the data prior to altering the column to CCSID 1200:  

                                                               
ALTER TABLE T1 ALTER COLUMN COL1                                
SET DATA TYPE VARCHAR(2048) ALLOCATE(30) CCSID 1208 NORMALIZED  

PTFs Available

R710 SI64626 PTF Cover Letter   1000
R720 SI64621 PTF Cover Letter   8032
R730 SI64627 PTF Cover Letter   8025

Affected Modules

         
         

Affected Publications

Summary Information

Status............................................ CLOSED PER
HIPER........................................... No
Component.................................. 5770SS1DB
Failing Module.......................... RCHMGR
Reported Release................... R720
Duplicate Of..............................




System i Support

IBM disclaims all warranties, whether express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. By furnishing this document, IBM grants no licenses to any related patents or copyrights. Copyright © 1996,1997,1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 IBM Corporation. Any trademarks and product or brand names referenced in this document are the property of their respective owners. Consult the Terms of use link for trademark information

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0"},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG15Q","label":"APARs - OS\/400 General"},"Component":"","ARM Category":[],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"V7R1M0;V7R2M0;V7R3M0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
17 March 2018