Project and Portfolio Management Practitioners Forum
Showing results for 
Search instead for 
Did you mean: 

Calling Stored Procedure

Go to solution
Dominic Almeida
Regular Collector

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

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
)+1, (num_chars
)+1 from dual
Jason Nichols K
Honored Contributor

Re: Calling Stored Procedure


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.

Dominic Almeida
Regular Collector

Re: Calling Stored Procedure

thx guys for the help, I understood the
concept now

BR - Dom
//Add this to "OnDomLoad" event