当前位置:数据库 > Oracle >>

Oracle中存储过程传入表名,动态清除该表的数据

Oracle中存储过程传入表名,动态清除该表的数据
 
create or replace procedure p_deletetable(i_tableName in varchar2)
 
as
 
dynamic_drop_sql varchar2(500);
 
 
begin
 
dynamic_drop_sql :=  'DELETE  FROM ' || i_tableName ;
 
 
execute immediate dynamic_drop_sql;
 
 
commit;
 
end p_deletetable;
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,