Question

I have a view with a certain field. Now I need to modify this field accordingly to some logic. I've implemented this logic in a stored procedure.

Now I want to execute this stored procedure and its result should be placed in a field of a view.

Procedure looks like this:

CREATE OR REPLACE PROCEDURE "ORDTEST"."DEPARTMENT_FULLPATH"
(depId IN VARCHAR2, path OUT VARCHAR2)
...

So it has one input parameter and one output parameter.

In a view I need something like this:

CREATE OR REPLACE VIEW kcv_journal_contract_reg AS
   ...
   SELECT DEPARTMENT_FULLPATH(field1),
   ...
Was it helpful?

Solution

Yegoshin Maxim given good solution for this.

you can return the desired value inplace of OUT parameter..

create or replace function "ORDTEST"."DEPARTMENT_FULLPATH" (depId IN VARCHAR2)
return VARCHAR2 as 
....
return path ;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top