Page 1 of 1

[Urgent] Mutiple Input Files and Mutiple Tables

Posted: Fri Jun 15, 2007 8:41 am
by quest_ds
Hi,

I am very new to DataStage and Data warehousing.
I am using DataStage 7.5.1 on Windows.

I want to insert data from a single csv into database (Oracle 10g).
The CSV File looks something like this:

XXX,001,PO,06/06/2006,USER
XXX,002,PR,08/12/2006,USER
YYY,APE,1200,EUR,12/12/2005,USER
YYY,ARE,1200,USA,2/2/2005,USER

where XXX,YYY is the code to indicate the table name (DB_XXX,DB_YYY)

Initailly I have to put these data's into a filler table (FILLER_TABLE)
Something like
Name Type
-------------------------------------------------
TABLE_CODE VARCHAR2(5)
FILLER_1 VARCHAR2(250)
FILLER_2 VARCHAR2(250)
FILLER_3 VARCHAR2(250)
FILLER_4 VARCHAR2(250)
FILLER_5 VARCHAR2(250)


Then I'll be putting them into respective tables (DB_XXX,DB_YYY).

My query is:
1) How to handle files which have varying columns?
2) In the transformer how do I tel it to go into a particular table based on the TABLE_CODE?
3) Please suggest any tutorial,example materials on net

Thank You

Posted: Fri Jun 15, 2007 8:47 am
by DSguru2B
Welcome Aboard
If you know the maximum number of columns your csv file can have, you can create the metadata according to that. For missing columns yo can go to the column's tab and specify the 'Missing Column' option, so that the sequential file stage wont complain.
You can set constraints in the transformer stage to split your records into multiple streams going down to different tables.
If you are completely new to the product, I would advise format training. Also go through the help pdf files.

Please do not use words like urgent and ASAP. This will only delay the response. This is an all volunteer site and urgent requires big bucks.

Posted: Fri Jun 15, 2007 11:25 pm
by quest_ds
Hi,
Thank you for the suggestion on the subject line. Will always keep in mind.

And also thanks a lot for your suggestion on the query.

Posted: Fri Jun 15, 2007 11:35 pm
by quest_ds
:roll:

How do I apply constraint in the transformer.?
I used

if TABLE_CODE = 'XXX'
then
input.Filler_1
else
log message

I want to know if there is any other approach for the same

Posted: Fri Jun 15, 2007 11:53 pm
by ray.wurlod
The constraint in the Transformer is applied in the Constraints grid. Choose the second tool from the left in the toolbar.
The constraint expression itself is a true/false for each output link, for example

Code: Select all

TABLE_CODE = "XXX"

Posted: Sat Jun 16, 2007 12:08 am
by quest_ds
My question is not answer :(

Posted: Sat Jun 16, 2007 12:20 am
by ray.wurlod
With more DataStage knowledge you'd appreciate that your question HAS been answered. And on a weekend, what's more. How much would THAT cost from your support provider?!!

Code: Select all

                         +--->  Table XXX   (constraint TABLE_CODE = "XXX")
  ------->  Transformer  +--->  Table YYY   (constraint TABLE_CODE = "YYY")
                         +--->  Table ZZZ   (constraint TABLE_CODE = "ZZZ")

Posted: Sat Jun 16, 2007 2:24 am
by quest_ds
All the answers in this forum seems to be only for the paid users. I cannot view your answer...

Have to check out some other forum.

Anyways thanks for responding.

Posted: Sat Jun 16, 2007 5:36 am
by ray.wurlod
There are only five premium posters. You can view all of everyone else's posts. Premium membership is one way to help to defray the bandwidth costs of DSXchange. It's only a few cents per day.

Posted: Sat Jun 16, 2007 6:53 am
by chulett
Nothing is stopped any of the other 17,000 members from posting answers to your questions. Problem is most of them tend to shy away from trying to conduct training sessions here, which is what looks to be needed and which is not the purpose of this site. We are a community of users, helping each other to solve problems. We're not a substitute for proper training. And as noted, your question actually has been answered, which is probably another reason you don't see anyone else popping in.

Anyway, check your duplicate thread (another frowned upon practice, please avoid doing so in the future) for more 'training like' answers.

Posted: Sat Jun 16, 2007 10:59 pm
by quest_ds
I have found my answer.

Posted: Sun Jun 17, 2007 12:49 am
by ray.wurlod
<color=blood>Customary practice here is that you make a final post letting future searchers know what the answer is, and mark the thread as Resolved.

Only the original poster can mark the thread as resolved.
</color>