Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 07 May 2008 @ 21:17:34 GMT


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


Subj:   Re: Fastexport a file then fastload the file
 
From:   Anomy Anom

<-- Anonymously Posted: Wed, 7 May 2008 16:13 -->

Here is an example of fastexport and fastload to copy a table from the database A (testdb) to B (testdb2). This sample uses a named pipe, instead of a data file.

1) fastexport

     .LOGTABLE utillog;
     .LOGON xxxx/yyyy,zzzz;
     .BEGIN EXPORT
        SESSIONS 4;

     .EXPORT
        OUTFILE \\.\pipe\Latin_GBK
        FORMAT FASTLOAD
        MODE INDICATOR ;

     SELECT *  from testdb.Latin_GBK ;

     .END EXPORT;
     .LOGOFF;

2) fastload

     SESSIONS 4;
     SET SESSION CHARSET 'UTF8' ;
     ERRLIMIT 1000;
     LOGON xxxx/yyyy,zzzz;
     DROP TABLE testdb2.Latin_GBK;
     DROP TABLE testdb2.Err1Latin_GBK;
     DROP TABLE testdb2.Err2Latin_GBK;

     CREATE SET TABLE testdb2.Latin_GBK ,NO FALLBACK ,
           NO BEFORE JOURNAL,
           NO AFTER JOURNAL
           (
            Id INTEGER,
            CodePage VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC,
            LCID VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC,
            Description VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC,
            CharData VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC)
     UNIQUE PRIMARY INDEX ( Id );

     BEGIN LOADING testdb2.Latin_GBK
     ERRORFILES testdb2.Err1Latin_GBK, testdb2.Err2Latin_GBK
     INDICATORS;
     axsmod c:\Windows\System32\np_AXSMOD.dll "fallback_directory=c:\";  /*
     only for named pipe */
     DEFINE
     field0(INTEGER),
     field1(VARCHAR(20)),
     field2(VARCHAR(20)),
     field3(VARCHAR(20)),
     field4(VARCHAR(200))
     File=\\.\pipe\Latin_GBK ;
     SHOW;

     INSERT INTO  testdb2.Latin_GBK
     (
     Id,
     CodePage,
     LCID,
     Description,
     CharData
     )
     VALUES
     (
     :field0,
     :field1,
     :field2,
     :field3,
     :field4
     )
     ;

     END LOADING;
     LOGOFF;


     
  <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