creating a blank 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
jshurak
Participant
Posts: 74
Joined: Mon Jan 09, 2006 12:39 pm

creating a blank table

Post by jshurak »

Does anyone know of a way to do this an ODBC stage? The reason for this is that, we need a job that will create and load a table on a DB2 system.
The table gets created but bombs when trying to load data. The error message points to a journaling issue. The table is not being journaled when it is created. We found out that it DOES get journaled by the DB2 system about 5 minutes after it is created.
So my thought was to created two different jobs, the first to create the table. The next job would load the table 10 - 20 minutes after the first job runs, allowing time for journaling to take place.
Any help would be greatly appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, just create a job that looks like it inserts data into the table, but don't actually send anything. Simplest to do this with a job that starts from a Transformer.

1) Create a dummy stage variable in the Transformer.
2) Set the constraint to @FALSE.
3) Include all the columns and set their derivations to @NULL.
4) Have the target stage drop/create the table and 'Insert without clearing'.

The constraint will ensure no rows go down the link, but the table will be created. And for #3 it doesn't really matter what you set the derivations to, they won't be used.

ps. Empty, not blank. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Is this a temp table?
Why are you creating it in DS, any specific reason?
If i were you, i would convince the dba to create the table pre-hand. This way all you need to do is just load the rows and by-pass any such issues.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply