0

I am trying to create a simple oracle function in table plus an I always get the following error in

"Query 1 ERROR: ORA-24344: success with compilation error"

Following is the function I am using to execute.

CREATE OR REPLACE EDITIONABLE FUNCTION "PMD_OWNER"."GET_SUM"
  (first_num INT, second_num INT) 
return INT 
IS 
  var_ret INT;  
BEGIN  
  var_ret := first_num + second_num  ;    
  return var_ret; 
END GET_SUM;
Littlefoot
  • 131,892
  • 15
  • 35
  • 57
Varma
  • 47
  • 4

1 Answers1

0

I suspect your Oracle database version is lower than 12c. EDITIONABLE won't work in 11g or lower so - I suggest you remove that keyword.

CREATE OR REPLACE FUNCTION pmd_owner.get_sum (first_num INT, second_num INT)
   RETURN INT
IS
   var_ret  INT;
BEGIN
   var_ret := first_num + second_num;
   RETURN var_ret;
END get_sum;

Also - although not related to your problems - don't get used to use double quotes with Oracle objects; avoid problems before they appear.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • I am still getting same error. "ERROR: ORA-24344: success with compilation error". The same statements works in other DB software like Dbvever, in dbvever we perform additional step to make the function created successfully, we right click and compile the function after it is created. I don't find a similar option in table plus. do you know is there any command we can use to compile a function. – Varma Feb 21 '20 at 17:51
  • Try to run`select * From user_errors;` which will show errors you got. Because, there's nothing *wrong* with this function. **Maybe** it has something to do with the owner; who is `pmd_owner`? Is it you? if so, you can omit it. If it is someone else, then you have to acquire privileges to create objects in their schema. – Littlefoot Feb 22 '20 at 07:50