Page 1 of 1

Declare/Use of Variables from SQL Oracle Table data?

Posted: Thu Oct 14, 2010 11:45 pm
by sanju4truefrnds
Hi ,

I would like to know how to declare the global variables and how we can use them in Datastage into expressions.

Actually I need to declare variables based on Oracle SQL Table data.
So wanted to know where we can write the query to declare the global variable?

Would appreciate the inputs !

Thanks !!

Posted: Fri Oct 15, 2010 6:33 am
by chulett
What version of DataStage? What operating system? Parallel or Server?

Posted: Fri Oct 15, 2010 3:20 pm
by ray.wurlod
And what do you mean by "global"? That is, what scope do you see these variables having - for example within a sequence, within a project or across multiple projects?

Posted: Sun Oct 17, 2010 10:09 pm
by sanju4truefrnds
Hi,

We have Datastage 8.1 Server Edition, And it is on Windows Server 2003.

By Global variables I mean to say,
It can be used across whole of the sequence Job.

Thanks & Regards,
Sanjeev

Posted: Mon Oct 18, 2010 1:12 am
by ray.wurlod
Declare them in a User Variables activity - they remain accessible to any activity downstream (that is, linked via any pathway to the User Variables activity).

Posted: Mon Oct 18, 2010 4:29 pm
by sanju4truefrnds
Hi,

Thanks for the response.

I thought in the same way, But I am stuck in User variable activity that How a variable can be declared from database oracle table.

In brief, I wanted to declare the variable and assign the value to it by using some sql query on database table. But i am not able to find any function or utility where i can write SQL queries directly to access the database tables.

Thanks & Regards,
Sanjeev

Posted: Tue Oct 19, 2010 12:14 am
by ray.wurlod
Use a Job activity upstream of the User Variables activity. In that Job activity run a job to fetch the value from Oracle and park it somewhere, for example in the job's user status area or in a file. The User Variables activity can then assign a value to the variable by accessing that value.