如果我想将插入语句作为参数传递给该函数并在函数中执行并返回值,我该怎么办
create or replace function new_record (p_name your_table.first_name%type)
return your_table.id%type
is
return_value your_table.id%type;
begin
begin
insert into your_table (id, first_name)
values (your_seq.nextval, p_first_name)
returning id into return_value;
exception
when dup_val_on_index then
return_value := 0;
end;
return return_value;
end;