Page 1 of 1

creating a blank table

Posted: Fri Jul 21, 2006 8:36 am
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.

Posted: Fri Jul 21, 2006 9:00 am
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:

Posted: Sat Jul 22, 2006 2:26 pm
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.