Page 1 of 1

How to get value of an Env variable in a stage of a job

Posted: Mon Aug 06, 2007 12:06 pm
by goutam
I have an oracle enterprise stage through which i want to load some data to a oracle table . I want to insert the USERID to one of the column of table through which datastage logon to oracle database. This USERID is parametrised and is an environment variable as $ORA_USER_SID. When i tried to insert this value i.e #$ORA_USER_SID# in write mode =upsert and user defined statement it is giving me an error. I also tried to extract this value of env variable thru utility function GetEnv (could not recollect the exact name) in transformer stage .But i am unsuccesful. Any suggestion?It's urgent

Posted: Mon Aug 06, 2007 1:29 pm
by Luciana
Hi Goutam

Try to use the function GetEnvironment('ORA_USER_SID') with this sintaxe.

Posted: Mon Aug 06, 2007 1:35 pm
by chulett
If it is already 'parameterized' - i.e. a Job Parameter, can you not just refer to the parameter name itself in that column's derivation?

Re: How to get value of an Env variable in a stage of a job

Posted: Mon Aug 06, 2007 2:07 pm
by DeepakCorning
Did u try to run ur user defined upsert without using the environment variable? Reason to ask this is that may be the error is not because of the parameter but in the User defined Statement.

Also you can try to assign the column the env variable in a transformer prior to the TGT stage.

Posted: Mon Aug 06, 2007 2:16 pm
by ray.wurlod
Procedural Note
We don't do "urgent" here. If you want urgent support, sign up with your support provider for premium support, and learn the true cost of urgent. This is an all-volunteer site; people post as and when they can, and are not paid for doing so.

Personal Note
Anyone marking a post as urgent causes my response to that post to be delayed.