Using a plsql function

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
Nareshkotti
Participant
Posts: 16
Joined: Thu Sep 08, 2011 8:29 am
Location: hyderabad

Using a plsql function

Post by Nareshkotti »

Hi All,

I need to use a function which will return one value.

for Ex: Sum Function which adds two input values and returns a value.

How can i use this function in datastage job?

Please explain in brief if someone knows this b'coz i never used scripts and functions in datastage.

Thanks in Advance!
Naresh
DataStage Developer
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The obvious answer is to use the function within a user-defined SELECT statement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nareshkotti
Participant
Posts: 16
Joined: Thu Sep 08, 2011 8:29 am
Location: hyderabad

Post by Nareshkotti »

ray.wurlod wrote:The obvious answer is to use the function within a user-defined SELECT statement. ...
Thanks for the reply ray.

yes we can call using the select statement, but i want to know how to call it from any of the other stages.

And how to invoke the procedures from datastage jobs please help me out if you have any idea.
Naresh
DataStage Developer
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It is not possible by any other means. A plsql function must be invoked from within an SQL statement. Therefore any stage that needs to use it must run some SQL. The stages that connect to Oracle are the only ones that can run Oracle SQL. (One exception: you could set up a command that runs sqlplus from the command line to execute an SQL statement, but that's introducing an extra layer of software (the operating system shell) for no good reason.)
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