[Urgent] Mutiple Input Files and Mutiple Tables
Moderators: chulett, rschirm, roy
[Urgent] Mutiple Input Files and Mutiple Tables
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
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
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.
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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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
The constraint expression itself is a true/false for each output link, for example
Code: Select all
TABLE_CODE = "XXX"IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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")IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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.
Anyway, check your duplicate thread (another frowned upon practice, please avoid doing so in the future) for more 'training like' answers.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
<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>
Only the original poster can mark the thread as resolved.</color>
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
