Staging table

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
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Staging table

Post by urshit_1983 »

Hi All,

I have to create staging table. That has to be done by entering custom SQL which is a bit complex as it has many joins. Can any body suggest how shall I proceed ?

Database is Oracle.

Can I do it by TOAD or DS ?

Thanks.
"Nobody is expert in Everything,
But Everybody is expert in Something."
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi urshit_1983
How many tables you have to join? I think u can do it in DS in the oracle database stage. let us know what kind of join you want to do and also the exact scenario....Then we can help you...

Thank you
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Post by urshit_1983 »

Join is not a problem other parameters are to be checked. Its like 3 to 4 tables. And I need a staging table to store this. So my question is , is DS required for this purpose or i can do it in TOAD ? To build staging table...

Thanks
"Nobody is expert in Everything,
But Everybody is expert in Something."
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Re: Staging table

Post by Krazykoolrohit »

urshit_1983 wrote: I have to create staging table.
To create the table use DDLs, run it on database. no need of datastage.

Even to populate the table, use oracle if you have no major transformations to be done on the data and you just need to make some joins and populate the staging table.
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Re: Staging table

Post by urshit_1983 »

Ok so Data stage does not come in the picture then. So the steps:

Create Table using TOAD
write required SQL
populate the table with required columns

Right ??
"Nobody is expert in Everything,
But Everybody is expert in Something."
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

In case you are obsessed on datastage :wink: create stored proc and call it from a datastage job or sequence 8)
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi urshit_1983,
Sorry, The way I took the question was different.I can suggest you the same as Krazykoolrohit..
urshit_1983 wrote:Join is not a problem other parameters are to be checked. Its like 3 to 4 tables. And I need a staging table to store this. So my question is , is DS required for this purpose or i can do it in TOAD ? To build staging table...

Thanks
Thank you
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Re: Staging table

Post by Krazykoolrohit »

urshit_1983 wrote:Ok so Data stage does not come in the picture then.
Not untill you have some transformations to be done on data. If you are just populating the tables, datastage may become an overhead for you.
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Post by urshit_1983 »

The only thing is complex SQL. Either I use DS or TOAD I have to write custom SQL. So I am asking is DS necessary or TOAD should be fine for the same ?

Or else make a table using TOAD and then use DS to load it ???
"Nobody is expert in Everything,
But Everybody is expert in Something."
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Like already discussed above
If your purpose is to create a staging table, without any transformations, you could do it using TOAD.

Create a table with the required coulmns.

Insert the results of your query into the table using

Code: Select all

Insert into <table-name> 
(
 <Your complex query>.
) 
The number of coulmns/datatype of columns in your table has to match the number of columns/datatype of your query output
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or simply:

Code: Select all

CREATE TABLE AS
(your query)
Two birds, one stone. DataStage is perfectly capable of creating any table you have the grants to create in TOAD. As to if you should use DataStage, that depends somewhat on what you are accomplishing here. A one time 'staging' of data? No, you're fine via TOAD. Something you'll need to 'stage' on a regular basis? Then yes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Post by urshit_1983 »

Thankyou everybody let me try that.
"Nobody is expert in Everything,
But Everybody is expert in Something."
Post Reply