create or replace procedure PRO_BUILDTMPTABLE(p_table in varchar,p_sql in varchar,p_type in number) is
/**
创建会话临时表
@author lnj
date 2012-3-2
参数说明
p_table 表名
p_sql 创建字段
p_type 创建临时表的类型
**/
v_sql varchar(1000);
begin
if p_type =1 then
v_sql:='CREATE GLOBAL TEMPORARY TABLE '||p_table||'('||p_sql||') ON COMMIT PRESERVE ROWS';
else
v_sql:='CREATE GLOBAL TEMPORARY TABLE '||p_table||'('||p_sql||') ON COMMIT DELETE ROWS';
end if;
execute immediate v_sql;
commit;
exception
when others then
pro_errorlog('PRO_BUILDTMPTABLE-->'||v_sql,sqlcode,sqlerrm);
end PRO_BUILDTMPTABLE;
/**
创建会话临时表
@author lnj
date 2012-3-2
参数说明
p_table 表名
p_sql 创建字段
p_type 创建临时表的类型
**/
v_sql varchar(1000);
begin
if p_type =1 then
v_sql:='CREATE GLOBAL TEMPORARY TABLE '||p_table||'('||p_sql||') ON COMMIT PRESERVE ROWS';
else
v_sql:='CREATE GLOBAL TEMPORARY TABLE '||p_table||'('||p_sql||') ON COMMIT DELETE ROWS';
end if;
execute immediate v_sql;
commit;
exception
when others then
pro_errorlog('PRO_BUILDTMPTABLE-->'||v_sql,sqlcode,sqlerrm);
end PRO_BUILDTMPTABLE;