create or replace procedure p_GetItemID( strInsertSQL varchar2, seqName varchar2, ID out varchar2 ) is strSql varchar(200); begin execute immediate strInsertSQL;--执行插入语句 strSql:='select '||seqName||'.currval from dual';--获取id的sql语句 execute immediate strSql into ID;--执行获取id的sql语句 EXCEPTION WHEN OTHERS THEN DBMS_output.PUT_LINE(SQLERRM); end p_GetItemID;