declare v_number NUMBER; v_number2 NUMBER; begin execute immediate 'truncate table t2'; insert into t2 select count(*) from dual; commit; begin insert into t2 select count(*) from t1; commit; end; end;
注:本人调试的最简版,前两处红色部分是为了输出Excel表格线:x:str表示输出为文本样式,避免被输出为科学计数法. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns:x="urn:schemas-microsoft-com