oracle function is accomplished using dynamic execute immediate pass table and the operation returns to the new primary key value 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;

  

Guess you like

Origin www.cnblogs.com/qinyios/p/11231017.html