|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/18/2006 9:52:00 AM
Posts: 2,
Visits: 1
|
|
Dear All,
I am totally new in Teradata. I have problem in fastload.
I have a data file containing following information
100,59,PEARL HEART LOCKET,285,1,40.99,4/11/2005 101,63,HARRY POTER,286,1,$40.99,4/11/2005 102,59,PEARL HEART LOCKET, 286,1,$40.99,4/11/2005 103,42,CK ONE SUMMER FOR, 287,1,$34.95, 4/11/2005 106,42,CK ONE SUMMER, 288,1,$34.95, 4/13/2005
and have following script
.sessions 2; .errlimit 50; .LOGON DemoTDAT/dbc,dbc;
.set record text
DATABASE ez;
DROP table CartLine1; drop table CartLine1_ERR1; drop table CartLine1_ERR2;
CREATE TABLE CartLine1 ( Cart_item_id varChar(10), Product_id varChar(4), Product_Name char(20), Cart_id varChar(5), quantity varChar(5), total_price varChar(5), date1 varChar(5) );
DEFINE Cart_item_id (varChar(10)), FILLER1 (CHAR(1)), Product_id (varChar(4)), FILLER2 (CHAR(1)), Product_Name (char(20)), FILLER3 (CHAR(1)), Cart_id (varChar(5)), FILLER4 (CHAR(1)), quantity (varChar(5)), FILLER5 (CHAR(1)), total_price (varChar(5)), FILLER6 (CHAR(1)), date1 (varChar(5)) FILE=C:\data.txt;
BEGIN LOADING CartLine1 ERRORFILES CartLine1_ERR1, CartLine1_ERR2 CHECKPOINT 10;
INSERT INTO CartLine1 ( Cart_item_id, Product_id, Product_Name, Cart_id, quantity, total_price, date1 ) VALUES ( :Cart_item_id, roduct_id, roduct_Name, :Cart_id, :quantity, :total_price, :date1 ); END LOADING; .LOGOFF;
when i execute it on fastload got following massages *************************************************************************
=================================== = = = Insert Phase = = = =================================== 0010 INSERT INTO CartLine1 ( Cart_item_id, Product_id, Product_Name, Cart_id, quantity, total_price, date1 ) VALUES ( :Cart_item_id, roduct_id, roduct_Name, :Cart_id, :quantity, :total_price, :date1 );
**** 17:03:36 Number of recs/msg: 973 **** 17:03:36 Starting to send to RDBMS with record 1 **** 17:03:36 Bad file or data definition. **** 17:03:36 The length of: CART_ITEM_ID in row: 1 was greater than defined. Defined: 10, Received: 12337 =================================== = = = Logoff/Disconnect = = = ===================================
**** 17:03:36 Logging off all sessions **** 17:03:36 Total processor time used = '0.015625 Seconds' . Start : Tue Jul 18 17:00:04 2006 . End : Tue Jul 18 17:03:36 2006 . Highest return code encountered = '0'. *****************************************************************************
Please help me in this regard. I think there is problem in data and script. Please correct it.
Thanks
ABID
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 10/7/2008 12:54:51 PM
Posts: 116,
Visits: 20
|
|
try this
set record vartext "|" NOSTOP;
sessions 2; .errlimit 50; .LOGON DemoTDAT/dbc,dbc;
.set record text
DATABASE ez;
DROP table CartLine1; drop table CartLine1_ERR1; drop table CartLine1_ERR2;
CREATE TABLE CartLine1 ( Cart_item_id varChar(10), Product_id varChar(4), Product_Name char(20), Cart_id varChar(5), quantity varChar(5), total_price varChar(5), date1 varChar(5) );
set record vartext "," NOSTOP; DEFINE Cart_item_id (varChar(10)), Product_id (varChar(4)), Product_Name (varchar(20)), Cart_id (varChar(5)), quantity (varChar(5)), total_price (varChar(5)), date1 (varChar(5)) FILE=C:\data.txt;
The rest of the stuff remains same.
the set record vartext "," defines the delimeter , and tells that it is not a fixed lenght file and all the fields should be defined as VARCHAR [there are a few exceptions though)
try this and see.
Feroz Shaik
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/18/2006 9:52:00 AM
Posts: 2,
Visits: 1
|
|
Its work............
Thanks you very much Feroz Shaik sb.
|
|
|
|