Usage of Teradata MLOAD stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sivatkv
Participant
Posts: 15
Joined: Tue Oct 13, 2009 2:32 am

Usage of Teradata MLOAD stage

Post by Sivatkv »

Hi,

We are having Oracle Connector as Source and Teradata MLOAD stage as target stage and in between,a transformer has been used in one of parallel jobs.When I select primary Index as key in MLOAD stage,the job works fine(No error but some records get dropped due to duplicates in Index value).However,when I select the primary key(as mentioned in the source and it being on different column from primary index in teradata table),the job fails saying 'UTY0805 RDBMS FAILURE : A MULTILOAD UPDATE STATEMENT IS INVALID. ' which is the error written in MLOAD log file.
We tried checking the script also and that seems to be fine.

Failing Statement:- UPDATE XYZ set A= :A,B=:B where P=P' /*where XYZ is target table name,Primary Index(in target) is on col(say) B and source primary key is on col P*/ ?

At the same time the other Update statement works fine i.e. UPDATE XYZ set P=P' ,A=:A where B=:B /*where XYZ is target table name,Primary Index(in target) is on col(say) B and source primary key is on col P*/

Could any one provide pointers on this?

Thanks in advance.
Regards,
Siva
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
Sivatkv
Participant
Posts: 15
Joined: Tue Oct 13, 2009 2:32 am

Usage of teradata MLOAD stage.

Post by Sivatkv »

Thanks for your response Craig.
So please check if got it correctly:-
In the where clause in update script(generated by MLOAD stage),it is a must to include Primary Index(on teradata table) with equity condition and this primary index should not be on Updateable column.
Regards,
Siva
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's the impression I got from googling around but I have no hands-on TD experience. Why not run this by your DBA?
-craig

"You can never have too many knives" -- Logan Nine Fingers
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Siva,

Try to do a metadata import in DataStage for this Teradata table and you will find out that the Primary Index columns are automatically translated to Key columns in DataStage. This is because Teradata uses the Primary Index (not the Primary Key) for its data distribution, data retrieval and joins.

So if you are doing an update (which requires key columns), the Primary Index columns should be marked as Key columns and then the Update will be successful as you have mentioned.

Tip: I always test the load with a Teradata API stage before moving to Teradata Multiload stage.

HTH
--Rich
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

your PI columns should be the same one used in the where clause.
Teradata Certified Master V2R5
Post Reply