MLoad Update
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


MLoad Update Expand / Collapse
Author
Message
Posted 10/20/2009 9:59:33 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/22/2009 4:02:36 PM
Posts: 16, Visits: 40
I have to Update only one field in the table with one valuea using MultiLoad (dont want to use BTEQ since DBA dislike to update table with >100k rows with BTEQ). For instance, SQL is following...


Update DB.TABLE1
SET FIELD1=703
WHERE FIELD1=1;

Now, i have done updates usnig field input, but never with one colum value. Do i have to treate this as file input and change SQL as below or is there any other way of doign it?

Update DB.TABLE1
SET FIELD1=:FIELD1
WHERE FIELD1=1;

Post #17109
Posted 10/20/2009 11:08:02 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Yesterday @ 3:55:54 AM
Posts: 111, Visits: 263
Multiload will only let you update records when the Where clause contains all the primary index fields (and preferably primary key), so you will have to create a file with the primary key of every record to update.

So assuming Table1 has Fields PK1 and Pk2, do a bteq export of:

Select PK1,PK2
From DB.Table1
Where Field1 = 1
;

The you can import these records to do the update with:

Update DB.TABLE1
SET FIELD1=703
WHERE PK1 = :PK1
And PK2 = :PK2
;

Make sure there are no updates on the table between the export and import!

If the table has 10M rows, but you only want to update a few thousand, I would go back to your DBA's and argue about bteq. It is not the size of the source, it is how many rows you update which causes the overhead.


Post #17112
Posted 10/20/2009 12:42:39 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/22/2009 4:02:36 PM
Posts: 16, Visits: 40
Actually all of the records will be updated with this new value for FIELD1. Since this table is huge, I intend to use MultiLoad Update.
Post #17114
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 10:30pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.125. 9 queries. Compression Disabled.