Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 07 Oct 2009 @ 19:54:43 GMT


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


Subj:   FASTEXPORT varchar TERADATA
 
From:   Dhervillez Baptiste

Hi,

I have a problem to export data by the utility FASTEXPORT.

I try to export a VARCHAR data, but for each row, a 16 bits integer is placed at the begining of the row.

Casting in CHAR is a solution that has been rejected because of the size the file generated (more than 600 Go instead of 350 Go).

Here is the script i have written :

     .LOGTABLE PAC_TMP_MM2_PAC_DEV.EXPORT_LOG; .RUN FILE "..\LOGON\LOGON_DEV";

     /*************************************************************************/
     /*PAC W_CREATE_EXPORT.CTL                                                */
     /*                                                                       */
     /*        CREATION DU SCRIPT POUR LES EXPORTS DES DF                     */
     /*=======================================================================*/
     /* parcours de la table de dictionnaire la geneneration des ordres       */
     /* d export.                                                             */
     /*                                                                       */
     /* INPUT :                                                               */
     /*     - PAC_R_DF_DICO_T : dictionnaire des DF                           */
     /*     - PAC_R_DF_DICO_F : dictionnaire des champs des DF                */
     /*                                                                       */
     /* OUTPUT :                                                              */
     /*      - DF_DICO.CSV : fichier plat de dictionnaire de donnees          */
     /*                                                                       */
     /*                                                                       */
     /*=======================================================================*/
     /*V10 091002 CREATION                                                    */
     /*************************************************************************/

     DATABASE PAC_SOC_MM2_PAC_DEV;

     .BEGIN EXPORT SESSIONS 20;
     .EXPORT OUTFILE "..\OUT\DF_DICO.CSV" FORMAT TEXT MODE RECORD;

     /*************************************************************************/
     /* dictionnaire de donnees                                               */
     /*************************************************************************/

     SELECT
      TRIM(TBL.TABLE_NAME_LN) || ';' ||
      TRIM(FLD.FIELD_NAME_LN) || ';' ||
      TRIM(FLD.FIELD_ID (INTEGER)) || ';' ||
      TRIM(FLD.FIELD_TYPE_DS )
     FROM PAC_R_DF_DICO_F FLD
     INNER JOIN PAC_R_DF_DICO_T TBL
     ON FLD.TABLE_ID = TBL.TABLE_ID
     ORDER BY TBL.TABLE_ID, FLD.FIELD_ID;

     .END EXPORT;

     .BEGIN EXPORT SESSIONS 20;
     .EXPORT OUTFILE "..\OUT\DF_MODALITE.CSV" FORMAT TEXT MODE RECORD;


     .END EXPORT;

     .LOGOFF;

and here is an extract of the result :

     $*NOM_TABLE/NOM_CHP/INDEX_CHP/TYPE_CHP
     @$DF_TIERS;COD_CPT_ID;0;Symbolic
     ,@DF_TIERS;COM_CANAL_ACQUISITION_LN;1;Symbolic
     ,*DF_TIERS;COD_ETAT_ACT_CD;10;Symbolic
     $@DF_TIERS;RGT_GES_ADV_CPT_2;100;Symbolic

I want to discard the first 2 caracters for each row.


Thanks a lot for your help.

Baptiste DHERVILLEZ



     
  <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: 15 Jun 2023