I want to execute this stored function, and insert data in table t I tried to find solution, but unsuccessfully
CREATE TABLE t (id number
, name varchar2(32)
, time date);
CREATE OR REPLACE PACKAGE t_api AS
FUNCTION func_ins (
p_row IN t%rowtype
) RETURN t.id%TYPE;
END t_api;
/
CREATE OR REPLACE PACKAGE BODY t_api AS
FUNCTION func_ins (
p_row IN t%rowtype
) RETURN t.id%TYPE
IS
l_id t.id%TYPE;
BEGIN
INSERT INTO t VALUES p_row RETURNING id INTO l_id;
RETURN l_id;
END func_ins;
END t_api;
/
declare
p_row t%rowtype;
begin
p_row.id := 1;
p_row.name := 'name';
p_row.time := sysdate;
t_api.func_ins(p_row);
end;
/
I got
PLS-00221
Thanks in advance