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;