oracle使用execute immediate方式完成函数动态传入表名并操作 返回新的主键id值
CREATE OR REPLACE FUNCTION SEQ1 (v_bname in VARCHAR2) return NUMBER is v_bcount NUMBER; BEGIN execute immediate 'select count(*) from '||v_bname into v_bcount; dbms_output.put_line(v_bname||'------------------'||v_bcount); return(v_bcount+1); end SEQ1;