Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 27 Feb 2008 @ 16:34:00 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   CAST error: 5355
 
From:   Anomy Anom

<-- Anonymously Posted: Wed, 27 Feb 2008 16:02 -->

Hi,

I have a view consisting of unioned selects. Each of the select runs correctly and union too, but when I run the view I get the error 5355.

"The arguments of the CAST function must be of the same character data type." I have no clue how to resolve the error. Thank you for your suggestions.

I am enclosing the query and table definition.

Database version is V2R5.

     replace view I_DEPM_C_EPM_Item_Source as
     select
        '6' as Error_Code,
        ceis.Item_Source_Code,
        translate(cast(Err.Error_Value as varchar(100)) using LATIN_TO_UNICODE) as Error_Value
     from data_ext_epm.C_EPM_Item_Source ceis
       join
     (select Source_Group_Code,
        ( translate(cast(min(Source_Group_Name) as varchar(100)) using LATIN_TO_UNICODE) ||
          translate('/' using LATIN_TO_UNICODE) ||
          translate(cast(max(Source_Group_Name) as varchar(100)) using LATIN_TO_UNICODE) )as Error_Value
     from data_ext_epm.C_EPM_Item_Source
     group by Source_Group_Code
     having (min(Source_Group_Name) <> max(Source_Group_Name))) Err on
          ceis.Source_Group_Code = Err.Source_Group_Code
     union all
     select
        '7'as Error_Code,
         ceis.Item_Source_Code,
         translate(cast(Err.Error_Value as varchar(100)) using LATIN_TO_UNICODE) as Error_Value
     from data_ext_epm.C_EPM_Item_Source ceis
       join
     (select Source_Group_Code,
        ( translate(cast(min(Source_Group_Name_EN) as varchar(100)) using LATIN_TO_UNICODE) ||
          translate('/' using LATIN_TO_UNICODE) ||
          translate(cast(max(Source_Group_Name_EN) as varchar(100)) using LATIN_TO_UNICODE) )as Error_Value
     from data_ext_epm.C_EPM_Item_Source
     group by Source_Group_Code
     having (min(Source_Group_Name_EN) <> max(Source_Group_Name_EN))) Err on
          ceis.Source_Group_Code = Err.Source_Group_Code;


     CREATE SET TABLE data_ext_epm.C_EPM_Item_Source ,NO FALLBACK ,
         NO BEFORE JOURNAL,
         NO AFTER JOURNAL,
         CHECKSUM = DEFAULT
         (
          Item_Source_Code CHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
          Item_Source_Name VARCHAR(60) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
          Item_Source_Name_EN VARCHAR(60) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
          Source_Group_Code CHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
          Source_Group_Name VARCHAR(60) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
          Source_Group_Name_EN VARCHAR(60) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL)
     UNIQUE PRIMARY INDEX C_EPM_Item_Source_UPI ( Item_Source_Code );


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016