Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apex page items calling an Oracle Function...

NazbitJul 19 2012 — edited Jul 20 2012
Hi,

I am trying to call a Function on my database from a page in APEX. This is probably very basic but I've searched a lot and I cant find any documentation on it, so I'm hoping that one of you can help me out.

I have written a very basic example function, that accepts a varchar and returns a number.

So what I would like to do now is create a page region with a text field where the user can key input that is passed to the function, and then have a display only item that shows the output of the function in the same page region.
 
create or replace
package pack_function_test
is

function fn_test (ca_character in VARCHAR2)
return number;

end;
 
create or replace
package body pack_function_test
is

function fn_test (ca_character in VARCHAR2)
return number
is

vl_number  number(1);

begin

IF ca_character = 'A'
  then 
    vl_number  :=  1;
    
elsif ca_character = 'B'
  then
    vl_number  :=  2;
    
end if;

RETURN vl_number;


    END;

end;
I've had some great help here in the past so I am looking forward to your responses.

Thanks!
This post has been answered by 560577 on Jul 19 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2012
Added on Jul 19 2012
2 comments
1,073 views