Cannot import file using Fastload

Tools

Cannot import file using Fastload

Hi:

I am trying to import file that was exported using fastexport.

Format of the Source table:

CREATE MULTISET TABLE test.testtable ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
ProcID DECIMAL(5,0),
QueryID DECIMAL(18,0),
DefaultDatabase VARCHAR(128),
SessionID INTEGER,
ClientAddr CHARACTER(45),
ClientID CHARACTER(30),
AppID CHARACTER(30),
StartTime TIMESTAMP(2),
FirstRespTime TIMESTAMP(2),
NumResultRows FLOAT,
QueryBand VARCHAR(6160),
ErrorText VARCHAR(1024),
ParserCPUTime FLOAT,
AMPCPUTime FLOAT,
MaxAMPCPUTime FLOAT,
TotalIOCount FLOAT,
MaxAMPIO FLOAT,
SpoolUsage FLOAT,
NumOfActiveAMPs INTEGER)
PRIMARY INDEX ( ProcID );

Script Used:

.LOGON u/p,*********;

.BEGIN EXPORT SESSIONS 16 16;

.EXPORT OUTFILE fast_export_testtable.dat FORMAT FASTLOAD MODE RECORD;

sel * from test.testtable;

.END EXPORT;

.LOGOFF;

.QUIT;

FASTLOAD SCRIPT That I am using unsuccessfully:

sessions 16;
errlimit 20;
logon 10.1.0.137/test,test;

/* Droping error tables */

DROP TABLE test.error_1;
DROP TABLE test.error_2;

set record vartext " " DISPLAY_ERRORS NOSTOP;

define
ProcID (VARCHAR(5)),
QueryID (VARCHAR(18)),
DefaultDatabase (VARCHAR(128)),
SessionID (VARCHAR(5)),
ClientAddr (VARCHAR(45)),
ClientID (VARCHAR(30)),
AppID (VARCHAR(30)),
StartTime (VARCHAR(2)),
FirstRespTime (VARCHAR(2)),
NumResultRows (VARCHAR(30)),
QueryBand (VARCHAR(6160)),
ErrorText (VARCHAR(1024)),
ParserCPUTime (VARCHAR(30)),
AMPCPUTime (VARCHAR(30)),
MaxAMPCPUTime (VARCHAR(30)),
TotalIOCount (VARCHAR(30)),
MaxAmpIO (VARCHAR(30)),
SpoolUsage (VARCHAR(30)),
NumOfActiveAMPs (VARCHAR(30))

file=/fast_export_test.dat;

show;

begin loading test.testtable errorfiles test.error_1, test.error_2;
insert into test.testtable (
:procid,
:queryid,
:defaultdatabase,
:sessionid,
:clientaddr,
:clientid,
:appid,
:starttime,
:firstresptime,
:numresultrows,
:queryband,
:errortext,
:parsercputime,
:ampcputime,
:maxampcputime,
:totaliocount,
:maxampio,
:spoolusage,
:numofactiveamps
);
end loading;
logoff;

I've tried setting the 'SET RECORD' to formatted but that doesn't work either. I get error like:

**** 08:59:06 Starting to send to RDBMS with record 1
**** 08:59:06 Bad file or data definition.
**** 08:59:06 The length of: PROCID in row: 1 was greater than defined.
Defined: 5, Received: 16347

Anyone shed some light on what I am doing wrong here.. Just to clarify ... the file was export for another TD Database (I didn't do the export) and I am trying to import in my test TD.
1 REPLY
N/A

Re: Cannot import file using Fastload

Well, the export used mode RECORD and format FASTLOAD (=internal binary format), but you try to load using VARTEXT (delimited text format).

You have to change the DEFINE to match exactly the column definitions of the testtable columns.

Dieter