0
我能做些什麼,如果我想插入語句傳遞給這個函數作爲參數,並在功能和返回值執行它通過查詢語句[INSERT,UPDATE]用作參數,並執行它
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;
使用動態SQL如執行即時'INSERT語句'; – Satya 2013-04-08 09:37:50
我如何使用它 – 2013-04-08 09:41:46