When I pass a parameter to a function call, I get the following error:
Error: PLS-00306: wrong number or types of arguments in call to 'GET_NUM'.
The code is as follows:
CREATE OR REPLACE PACKAGE BODY TESTJNSABC IS
-- FUNCTION IMPLEMENTATIONS
FUNCTION get_num(num IN NUMBER)
RETURN VARCHAR2 IS
my_cursor VARCHAR2(20);
BEGIN
IF get_num = 1 THEN
my_cursor:= 'hello world';
ELSE
my_cursor:= 'Hi!';
END IF;
RETURN my_cursor;
END;
-- PROCEDURE IMPLEMENTATIONS
PROCEDURE testingabc AS
x NUMBER(3);
BEGIN
x:= 2;
dbms_output.put_line(get_num(x));
END testingabc;
END TESTJNSABC;
IF get_num = 1; what do you expect this to do?get_numneeds a parameter. what you want is probablyIF num = 1 THENwhich is your parameter.get_numwithout parameters, while it has one input parameter. What do you need to do with that line of code?