Page 1 of 1

Output Link Variable - OTHERWISE for Reject

Posted: Thu Mar 29, 2007 9:48 am
by DS_MJ
Hello:

How to implement the following in PX job.

"IsNull(COL_ID) Or toTarget_Table.REJECTED" (Server job)

Code: Select all

DB2 Table -----Transformer -----Target Table
                     |
                     |
                  Error Table
In the PX I see link variable -->output -->Otherwise in the transformer. But I dont understand "What otherwise is suppose to achieve". The manual is sometimes difficult to follow.

What the job needs is the following:

1 - Do insert only without clearing in the target if COL_ID is not null.
2 - In the Error Table capture rows that are null for COL_ID or any row rejected on the Target table.

How do I capture the rejects besides the Null for COL_ID in PX and send it to the Error table? Any guidence would be much appreciated.

Posted: Thu Mar 29, 2007 10:01 am
by DSguru2B
In px, database stages support reject links. You need a link coming out of your target database stage going into the error table. This way two links will be feeding to the error table. One from the transformer where the null checking is done and the other from your target database stage if the insert fails.

Posted: Thu Mar 29, 2007 12:23 pm
by DS_MJ
Thank you DSguru2B.

However my Target table is a Dynamic RDBMS and so is the Error table and when I try to link these two tables it says
The Destination stage cannot support any more stream input Links
[/code]

Thanks Much.

Posted: Thu Mar 29, 2007 12:46 pm
by DS_MJ
An Dynamic RDBMS - DBMS Type is MSSQL server.

Posted: Thu Mar 29, 2007 12:54 pm
by DSguru2B
No problem. Use another DRS stage to load the same error table. Or collect your rejects in a single file and then load it to the error table in another job or so.

Posted: Thu Mar 29, 2007 1:08 pm
by DS_MJ
DSguru2B wrote:No problem. Use another DRS stage to load the same error table. Or collect your rejects in a single file and then load it to the error table in another job or so.
I thought that I could create a reject link going to a seq file and in another job used this DataSet file to load into the Error table however,When I try to create a link from the source stage (Target table ) it give a message
The source stage does not support non-reject output links whilst it has input links

Posted: Thu Mar 29, 2007 1:36 pm
by DSguru2B
Yes. Make sure it is a reject link.

Posted: Thu Mar 29, 2007 1:36 pm
by DS_MJ
Hello DSguru2B:

What if I checked the little box in the transformer that says otherwise / log - where I put the constraint for if not null then load into the target. then get a reject link out of transformer to a dataset. Would it then capture rows rejected other then the not null into this link?

Thanks much.

Posted: Thu Mar 29, 2007 1:38 pm
by DSguru2B
Any record that is rejected by the database due to any reason will go down the reject link

Posted: Thu Mar 29, 2007 4:04 pm
by ray.wurlod
Database rejects will NOT go down the reject link of a Transformer stage.

The rejects link (which is NOT the same thing as the Otherwise/Log link) handles input rows that cause an exception in the stage, for example an attempt to divide by zero or to take the square root of a negative number.

Database rejects are captured in the reject link of an Enterprise stage. Try using the SQL Server Enterprise stage instead of the Dynamic RDBMS stage.