你最后没commit
CREATE OR REPLACE PROCEDURE test1
IS
tmpVar NUMBER;
strSQL VARCHAR2 (2000);
BEGIN
strSQL := 'drop table test';
EXECUTE IMMEDIATE strSQL;
strSQL := 'CREATE TABLE DDCXD.test(bh NUMBER)';
EXECUTE IMMEDIATE strSQL;
strSQL := 'select count(*) from local_xx';
EXECUTE IMMEDIATE strSQL into tmpVar ;
strSQL := 'insert into test values(' || tmpVar || ')';
EXECUTE IMMEDIATE strSQL;
commit;
END test1;
这样就行了