Problem with Multiload Accept

Tools & Utilities
Enthusiast

Problem with Multiload Accept

Hi I am trying to Run Multiload by exporting date in a file and then using it...
Following is the code i am running

.EXPORT REPORT DDNAME DELDATE

sel end_date (title '') from tableA;
.EXPORT RESET

while using in MULTILOAD i am giving as

.ACCEPT DELDTE FROM FILE DELDATE;

DELETE FROM TABLE B WHERE CURRENT_DATE<(&DELDTE-10);

but it is replacing it as
DELETE FROM TABLE B WHERE CURRENT_DATE<(2009-10);
And coming out with an error.
but it shud be
DELETE FROM TABLE B WHERE CURRENT_DATE<(2009-01-23 -10);
Please clarify how to export a date format correctly and use it in MLOAD USING ACCEPT OPTION.
7 REPLIES
Enthusiast

Re: Problem with Multiload Accept

iF qUESTION IS SOMEWHAT CONFUSING PLEASE TELL..
Enthusiast

Re: Problem with Multiload Accept

Hello,

for that, you can need to cast the date with the appropriate date format.

Regards,
Maran
Enthusiast

Re: Problem with Multiload Accept

Hi
All i want is to export a date in format'YYYY-MM-DD'
And use it in ACCEPT command
Problem is that it is taking 2009-12-31 as three separate fileds....
I hope it clarifies your query....
Enthusiast

Re: Problem with Multiload Accept

EXPORT REPORT DDNAME DELDATE

sel end_date (title '') from tableA;
.EXPORT RESET

try like this

EXPORT REPORT DDNAME DELDATE

sel end_date (title '') (FORMAT 'YYYY-MM-DD') (CHAR(10))
from tableA;
.EXPORT RESET
Teradata Employee

Re: Problem with Multiload Accept

.ACCEPT only supports numeric values and quoted strings as input, so you have two options for your EXPORT. Convert to a numeric INTEGERDATE string, e.g.:

sel TRIM(cast(end_date as INTEGER)) (title '') from tableA;

Put the date string in quotes, e.g.:

sel ''''||CAST(end_date as CHAR(10))||'''' (title '') from tableA;

Enthusiast

Re: Problem with Multiload Accept

Hi,

I was thinking as why to export the date first and then subsequently read it from file as parameter Can't this be done is one step like

DELETE FROM TABLE B WHERE CURRENT_DATE<(sel end_date -10 from table A);
assuming mload login credentails hs select access to A and Delete privileges on B this is much simpler approach..

Enthusiast

Re: Problem with Multiload Accept

This might be out of context but I have a small question, does .ACCEPT take 0 as well i.e if we have 010 in the file does it take 010 or only 10.....? Is there a way to make it take 010 as input using a file....?