RECORD_TYPE FROM 3 SOURCES

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

RECORD_TYPE FROM 3 SOURCES

Post by bobby »

HI
I have target FCT_JOB_EQUIPMENT WITH COULUM REC_TYPE THE STABLE IS SOURCED OUT OUT OF THREE 1)STG_JOB_EQUIPMENT2)STG_CUST_RETURN3)STG_JOB_RETURN IF THE SOURCE IS STG_JOB_SHIPMENT THEN INSERT "SHIPPED EQUIPMENT"
IF THE SOURCE IS STG_CUST_RETURN THEN INSERT RETURNED BY CUSTOMER
IF THE SOURCE IS STG_JOB_RETURN THEN INSERT RETURN RETURNED BY INSTALLER

ALL THE OTHER COULMS I AM USING STG_JOB_SHIPMENT AS SOURCE ON THIS COLUM REQ IS LIKE THIS IT WANTS THREE SOURCES PLZ ADVICE.
THANKS,
BOBBY
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
My assumption is that you ahve three input tables
1) STG_JOB_EQUIPMENT
2) STG_CUST_RETURN
3) STG_JOB_RETURN

Target table is FCT_JOB_EQUIPMENT

From three input sources, you are writing to the target table.
When the record is inserted from STG_CUST_RETURN, you want to write value "Returned by Customer
When the record is inserted from STG_JOB_RETURN , youwant to write value "Returned by Installer" ......

Solution-
In the transformer stage, for the column REC_TYPE,
you can put if then else if condition like
If STG_CUST_RETURN.input column then "Returned by Customer" else if
" STG_JOB_RETURN.input_column then "Returned by Installer" ...



Ketfos
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

hi,
bascially i wanna append all new record to same fct_table from stg
i have one ETL_control key which take care of integration now when i try to append that recors the etl key says now duplicate etl key
how can i take care of etl key
thanks
bobby
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Bobby,

Are you saying that you want to append rows from STG_JOB_EQUIPMENT to FCT_JOB_EQUIPMENT, and update rows from STG_CUST_RETURN and STG_JOB_RETURN in FCT_JOB_EQUIPMENT?
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

hi chuck,
thanks buddy i got it.
thanks
bobby
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Anytime. :)
Post Reply