0

From a page process in Apex, I'm trying to call a function which resides in a package in my oracle database. I am able to call a procedure with the following call:

#OWNER#.package_name.procedure_name( p1 => p2);

According to one of the requirements, I have to check whether a particular function returns true or false and perform actions accordingly. So for the pl/sql source(in apex) i'm trying this:

BEGIN

IF (#OWNER.package_name.function_name(p1)) THEN
--do something

END;

But it says the function needs to be declared (getting this error in apex), I am not able to figure out where am I going wrong. I'm really new to APEX, so any help would be appreciated. And also if anybody knows any tutorials where I can learn more about accessing pl/sql code(in oracle db) from apex pages, that'd be really great!

user1481789
  • 49
  • 3
  • 11

1 Answers1

0

Does the user you use to connect to database from APEX have privilege to execute that function?

Can you log in to your database as that user and try to execute that function?

Can you try creating a PUBLIC SYNONYM for the package which contains the function and try calling it without the name of the schema the package belongs to?

You can check if that user has privileges using (best log in as that user):

SELECT *
  FROM user_tab_privs -- or dba_tab_privs if logged as sys etc.
WHERE grantee = 'YOUR_USERNAME'
  AND privilege = 'EXECUTE'
  AND table_name = 'YOUR_PACKAGE_NAME'
;
Przemyslaw Kruglej
  • 8,003
  • 2
  • 26
  • 41