Page 1 of 1
Transfmer without an input link?
Posted: Thu Apr 19, 2007 5:59 am
by georgesebastian
Hi Everyone,
Will transfmor work with out an input link?
I know 1 way using stage variable and using constraint
Like @inrownum <1
Heard there are other ways can any one tell me?
Posted: Thu Apr 19, 2007 6:01 am
by chulett
No, there's no other way. You need a stage variable so the job will compile and a constraint so it doesn't generate an infinite number of rows.
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Thu Apr 19, 2007 6:29 am
by chulett
He didn't tell you because there is no other answer. A least I've never heard of one. Trick question. Be happy to be proven wrong, however!
Posted: Thu Apr 19, 2007 7:46 am
by DeepakCorning
I agree ! U can have transformer without any input link but u will need to put a constraint in it and that you can do only through a stage variable and the reason is simple - there is no input :D
Posted: Thu Apr 19, 2007 12:52 pm
by rafik2k
Good post!
I was also thinking to post the same.
Thanks georgesebastian
![Smile :)](./images/smilies/icon_smile.gif)
Posted: Thu Apr 19, 2007 1:08 pm
by DeepakCorning
Same interview??
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Thu Apr 19, 2007 2:55 pm
by ray.wurlod
Observation: @INROWNUM < 1 will "work" - inasmuch as the job will compile and run without error, evaluating its stage variable(s) - but will not generate any rows.
The "other way" is probably to have a before-stage or after-stage subroutine.
Posted: Thu Apr 19, 2007 3:02 pm
by chulett
Not generating any rows may be exactly what you want. I typically do that for either zero rows with an @FALSE constraint or for one row with @OUTROWNUM=1 constraint. The former might be used to clear a hashed file or truncate a table, for instance - the latter to trigger something 'special' in an OCI stage or for the STP stage.
Hadn't thought about the routine... a 'no op' routine perhaps? Its only purpose would be to appease the compiler, it would seem.
Re: Transfmer without an input link?
Posted: Sun Apr 22, 2007 11:52 pm
by baglasumit21
georgesebastian wrote:Hi Everyone,
Will transfmor work with out an input link?
I know 1 way using stage variable and using constraint
Like @inrownum <1
Heard there are other ways can any one tell me?
@inrownum wont work as there is no input link and it wont generate the row. your constraint should be @outrownum<2