All Forums Tools
kishu 26 posts Joined 03/08
01 Mar 2008
Problem in importing data from text file to teradata database using bteq

When i export the data from a table to any text file using bteq then data is written correctly in text file. But when i again import the same data from text file (skipping the title line) to same table, data is inserted successfully but some garbage value instead of the actual data. I am using normal select and Insert command for a single data only.please anyone suggest me the solution?thanx in advanceRegards,Kunal

joedsilva 505 posts Joined 07/05
01 Mar 2008

can you share your scripts, table structure, sample data etc...May be it's just a data conversion issue.

kishu 26 posts Joined 03/08
02 Mar 2008

i am using just a simple table:create table EMP(empid integer);exporting the data from table using this :.export report FILE='c:\......\bteqfile.txt'select empno from USER1.EMp;.export resetand again inserting the data(by first making table empty) using this .iMPORT REPORT FILE='c:\......\bteqfile.txt', SKIP=2using (empno integer)insert into USER1.EMP(empno)values (:empno);waiting for your replythanks and regards,Kunal

Fred 1096 posts Joined 08/04
02 Mar 2008

The USING phrase must describe the input data, not the table. You used REPORT format for your export, so that data is CHAR not INTEGER. If you are using the default INTEGER format '-(10)9', then your USING needs to say CHAR(11).

kishu 26 posts Joined 03/08
03 Mar 2008

thanx its now working but why length of the char is 11

Fred King 2 posts Joined 03/08
14 Mar 2008

CHAR(11) is one byte for the sign byte.

lpandu 3 posts Joined 10/14
15 Oct 2014

Wow !!! its working for me too... thanks to Fred King...

You must sign in to leave a comment.