What should be the Before clause in Teradata Mload?

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
nayanpatra
Participant
Posts: 41
Joined: Sat Jun 06, 2009 11:13 pm
Location: Kolkata

What should be the Before clause in Teradata Mload?

Post by nayanpatra »

I am currently trying to insert data into Teradata Mload table. It's working fine. But what should be the BEFORE CLAUSE that can be used so that the table may be truncated or deleted or released before it starts processing?

Can anybody help me with the list of commands that will be applicable in the BEFORE (M)LOAD CLAUSE?
Nayan
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

any DML
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your Teradata DBA?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: What should be the Before clause in Teradata Mload?

Post by ray.wurlod »

nayanpatra wrote:I am currently trying to insert data into Teradata Mload table. It's working fine. But what should be the BEFORE CLAUSE that can be used so that the table may be truncated or deleted or released before it starts processing?
The correct command to clear that particular table.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nayanpatra
Participant
Posts: 41
Joined: Sat Jun 06, 2009 11:13 pm
Location: Kolkata

Example

Post by nayanpatra »

keshav0307 wrote:any DML
Is there any particular syntax for it? Could you please give me some examples?
Nayan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's a Teradata command, not a DataStage command. Because we don't know all the identifier names in your Teradata installation, we can not help. Ask your database administrator (DBA) for assistance on Teradata command syntax.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nayanpatra
Participant
Posts: 41
Joined: Sat Jun 06, 2009 11:13 pm
Location: Kolkata

Identifier names of my Teradata installation

Post by nayanpatra »

ray.wurlod wrote:It's a Teradata command, not a DataStage command. Because we don't know all the identifier names in your Teradata installation, we can not help. Ask your database administrator (DBA) for assistance ...
I checked with the DBA. Actually I want to delete the Teradata tables before inserting data into them. Some of the installed queries applicable are delete, drop, release. But there is no identifier for truncate. So to be precise how am I going to use the delete syntax.

I have already tried with the delete command. But hasn't worked. I suppose there is a particular syntax for it. Could you please help me with the right syntax?
Nayan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That is why you have a DBA supporting you, ask them. Or wait for someone here who may know Teradata to stumble across this post. I, for one, do not.
-craig

"You can never have too many knives" -- Logan Nine Fingers
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

it should generate the drop statement itself for all the tables your specifying for Mload........ for the before command we usually check the two options specified in datastage in the before tab.
Teradata Certified Master V2R5
RShiva
Participant
Posts: 6
Joined: Tue Dec 27, 2005 3:54 am

Post by RShiva »

hamzaqk wrote:it should generate the drop statement itself for all the tables your specifying for Mload........ for the before command we usually check the two options specified in datastage in the before tab.
Apart from checking two options ( one to Drop error tables and second to treat SQL errors as non fatals) use below command
in before --script in TD Mload stage.

delete from <DATABASE_NAME>.<TABLE_NAME> all;

This has worked for us to delete the table before load by using mload stage(script).
Again if you need the stats of records went to error table then dont check -Drop error tables option.
Shiva
Post Reply