Load flat file in consecutive order to Teradata

Database
Teradata Employee

Load flat file in consecutive order to Teradata

Hi,

I have the next situation, i need to load a flat file in a consecutive order to teradata, i mean in teradata i expect to see the records in the same order i had in the flat file

Example :

flat file:

Record a

Record b

Record c

Record d

.

.

.

.

Record n

 Teradata  Table

Column 1   column n 

Record a      1

Record b      2

Record c      3

Record d      4

.

.

.

.

Record n    n

Any idea and how can i do it ??? 

Thanks for any help

4 REPLIES
N/A

Re: Load flat file in consecutive order to Teradata

Add an IDENTITY column to the target table and load it via Fastload/MLoad.

When i tested this a few years ago the number was assigned exactly in input file sequence. I don't think this changed in later releases.

Dieter

Teradata Employee

Re: Load flat file in consecutive order to Teradata

I tested using the next target table:

CREATE SET TABLE DD_STG_PNR.PRUEBA_TABLE

  (

   INC_COL INTEGER GENERATED BY DEFAULT AS IDENTITY

       (START WITH 1

        INCREMENT BY 1) ,

   CADENA VARCHAR(10) NOT NULL

  )

UNIQUE PRIMARY INDEX (INC_COL);

The flat file contains: 1,2,3,4,5,6,7,8,.......1 000 000

When i load this file using the fastload the result is

   INC_COL CADENA

   1       5943

   2       5944

   3       5945

   4       5946

   5       5947

   6       5948

   7       5949

   8       5950

   9       5951

 10       5952

 100001      1

  100002      2

  100003      3

  100004      4

  100005      5

  100006      6

  100007      7

  100008      8

  100009      9

 So, i have a problem 'cause i need the file in a sequence order :(

any other suggestion ??

Thanks

N/A

Re: Load flat file in consecutive order to Teradata

Oops, sorry.

Now i remember, you have to use a single FastLoad session.

Dieter

Teradata Employee

Re: Load flat file in consecutive order to Teradata

Thanks, you're rigth it works !!!!

:)