1

Had a cvs file containing 3 fields

1,cat,2012-06-16,2013-06-16 
1,cat,2013-06-16,

I am trying to load that to temporal table having valid_dt PERIOD(DATE) using fastload script

nonsequenced validtime    
INSERT INTO financial.test1 (id,name,valid_dt) values
(:id,:name,period( cast(:start_dt as date FORMAT 'YYYY-MM-DD'),cast(:end_dt as date FORMAT  'YYYY-MM-DD'))
);

Error I got is RDBMS error 3618: Expression not allowed in Fast Load Insert, column INTERNALPERIODDATETYPE.

could not find any in manuals, they only said it will be possible with fastload.

Thankyou.

user2711819
  • 960
  • 3
  • 16
  • 29

1 Answers1

1

FastLoad doesn't allow ANSI style CAST, must be old Teradata style instead:

:start_dt (date, FORMAT 'YYYY-MM-DD')

But there's no old-style PERIOD cast and FastLoad also doesn't allow any kind of expression and PERIOD(...) is an expression.

So you can only load data which can be automatically converted to a PEROD like:

1;cat;(2012-06-16, 2013-06-16) 
1;cat;(2013-06-16, 9999-12-31)

Including the parens, the blank after the comma and a different delimiter...

I would suggest simply loading the data as DATEs (or CHARs) into a staging table using FastLoad or MultiLoad, followed by a

nonsequenced validtime    
INSERT INTO financial.test1 (id,name,valid_dt) values
select id, name, period(start_dt,COALESCE(end_dt, date '9999-12-31'))
from stagingtable
dnoeth
  • 59,503
  • 4
  • 39
  • 56