Project and Portfolio Management Practitioners Forum
cancel

Calling Stored Procedure

SOLVED
Go to solution
Highlighted
Dominic Almeida
Respected Contributor.

Calling Stored Procedure

Hi, there

Is is possible that we call a PL/SQL stored procedure from a "Rule" and display its result in any field?

Regards - Dom
3 REPLIES
Marlene Mazzeo
Super Contributor.
Solution

Re: Calling Stored Procedure

I have never tried a PL/SQL stored procedure, but we are successfully using functions. In this example, our function is called num_chars:

select (num_chars
('[REQD.P.P_INFORM]',',')
)+1, (num_chars
('[REQD.P.P_INFORM]',',')
)+1 from dual
Jason Nichols K
Acclaimed Contributor.

Re: Calling Stored Procedure

Dom,

By definition, Procedures do not return a value, so you would need to be using a Function. But to answer the questions, yes, you can call a function and return the value to a field in a Rule. However, as opposed to the previous repsonse, I would write the select statement this way:

SELECT x.val FROM (SELECT customFunction(param1, param2, ...) val FROM DUAL) x

This way, the function is only called one time, instead of twice. If the function has a lot of heavy calculations, this would cut down on the database processing.

Jason
Dominic Almeida
Respected Contributor.

Re: Calling Stored Procedure

thx guys for the help, I understood the
concept now

BR - Dom