Declare/Use of Variables from SQL Oracle Table data?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sanju4truefrnds
Participant
Posts: 3
Joined: Thu Oct 14, 2010 11:27 pm
Location: SYDNEY

Declare/Use of Variables from SQL Oracle Table data?

Post 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 !!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What version of DataStage? What operating system? Parallel or Server?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sanju4truefrnds
Participant
Posts: 3
Joined: Thu Oct 14, 2010 11:27 pm
Location: SYDNEY

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sanju4truefrnds
Participant
Posts: 3
Joined: Thu Oct 14, 2010 11:27 pm
Location: SYDNEY

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply