Mload delete and update task

Database
The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.
Enthusiast

Mload delete and update task

Hi All,

 

I have a requirement to perform delete/update and insert action on one table. I wrote script like as given below :

 

.BEGIN IMPORT MLOAD
TABLES db.Customer;


.LAYOUT custlayout1;

.FIELD "Country" * Varchar(20);
.FIELD "Brand/Therapy" * Varchar(500);
.FIELD "GeoSegmentation Region" * Varchar(500);
.FIELD "Unique Visitors" * Varchar(20);
.FIELD "Date" * Varchar(10);
.FIELD "Sheet name" * Varchar(30);
.FIELD "user segment" * Varchar(30);
.FIELD "Data Segment" * Varchar(30);
.FIELD "Time Period" * Varchar(100);


.LAYOUT custlayout;

.FIELD "Country" * Varchar(20);
.FIELD "Brand/Therapy" * Varchar(500);
.FIELD "GeoSegmentation Region" * Varchar(500);
.FIELD "Unique Visitors" * Varchar(20);
.FIELD "Date" * Varchar(10);
.FIELD "Sheet name" * Varchar(30);
.FIELD "user segment" * Varchar(30);
.FIELD "Data Segment" * Varchar(30);
.FIELD "Time Period" * Varchar(100);

.DML LABEL lblDelete;

Delete from db.Customer Where "Country"=:Country and "Date"=:"Date";
.IMPORT INFILE 'Customer.csv'
format vartext ','
LAYOUT custlayout1
Apply lblDelete;

 

.DML LABEL lblConversion;
INSERT INTO db.Customer.*;
.IMPORT INFILE 'Customer.csv'
format vartext ','
LAYOUT custlayout
apply lblConversion;

.END mload;

.LOGOFF;

 

 

Its been executing fine but giving me error when I execute the same twice i.e. UV_Customer for table 

 

uty0805 3803 error.

 

Can anyone help me in fixing above issue.

 

Thanks,

Anuj Kumar

 

1 REPLY
Enthusiast

Re: Mload delete and update task

Seems like previous mload job did not complete sucessfully leaving behind UV_Customer table. Just try to drop this table and rerun.

 

From Teradata manual:

3803 Table ’%VSTR’ already exists.
Explanation: The user tried to create a table, view, macro, trigger, procedure or function and a table with that name
already existed. This error occurs on the CREATE TABLE, VIEW, MACRO, TRIGGER, PROCEDURE or FUNCTION statement.
Generated By: RES and OPT modules.
For Whom: End User.
Remedy: Examine the Teradata SQL statement and verify that the request is correct. Change the statement to specify a
different name and resubmit the request.