Teradata Enterprise stage dynamic lookup

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
AKUMAR21
Participant
Posts: 30
Joined: Fri Jul 20, 2007 12:44 am
Location: Chennai

Teradata Enterprise stage dynamic lookup

Post by AKUMAR21 »

My TD Enterprise stage is acting as a source that queries a couple of tables using joins. These tables are getting parallelly updated by other jobs.

The records queried by the TDE stage pass through a lookup stage and based on a particluar column value the matching records are inserted/updated to the target table via TPUMP stage.

As and when the source tables get updated in the real time process the lookup needs to be refreshed i.e. the query in Teradata Enterprise stage
should be proccessed again. Is there any option to do so. Do we have any APT parameters that would help in this scenario?
"In god we trust; rest all we virus scan"
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

What is the source stage of the look-up? Dataset, fileset, Flat File, etc.? You appear to be saying that the source of the lookup is static, therefore it isn't a DBMS stage of some kind. What it is?
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

your problem is not very clear to me.
how do you expect a record which was already extracted and is in the datastage server, to be updated automatically which is updated in the database.
the updated records after the extract will be updated only on the next run.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Teradata is one type of database that does not support sparse lookups (where the SQL is fired for every row being processed). It only supports normal lookups where the lookup data is cached when the job starts. You could try doing all your updates on a shadow table (dataset) on the ETL server using change capture and change apply stage and then load the changed table into Teradata.
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

Can anybody explain what could be the alternate way if sparse lookup is required on the teradata table for runtime implementation?
Birendra
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

using ODBC stage, you can get the functionilty of sparse loolup
AKUMAR21
Participant
Posts: 30
Joined: Fri Jul 20, 2007 12:44 am
Location: Chennai

Post by AKUMAR21 »

However when we connect ODBC enterprise stage with lookup stage and choose the sparse lookup option, we are not able to choose the column meant for lookup in the lookup stage. It says "Key expressions cannot be set on key columns of this link. The connected stage defines the key lookup."
"In god we trust; rest all we virus scan"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's correct. Therefore you must have a stream input column that matches the lookup key column name and data type. This will be used to supply the value to be looked up. Use a Copy stage which can rename the column at no cost.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Sparse lookups do not use drag and drop for matching of key columns, rather they automatically match columns where the lookup column is identified as a key and the input link has a column with an exact matching name and metadata (as pointed out by Ray).
Post Reply