日期:2014-05-16 浏览次数:20425 次
CREATE OR REPLACE PROCEDURE P_EXPORTDATA(TAB1 IN VARCHAR2, TAB2 IN VARCHAR2) Authid Current_User IS D_SQL varchar2(100); TABLE_SQL VARCHAR2(2000); INDEX_1 VARCHAR2(2000); INDEX_2 VARCHAR2(2000); BEGIN D_SQl := 'drop table ' || TAB1; TABLE_SQL := 'create table ' || TAB1 || ' as select * from ' || TAB2; INDEX_1 := 'create index idx_1 on ' || TAB1 || '(busiid asc, latest asc, remarks asc, status asc)'; INDEX_2 := 'create index idx_2 on ' || TAB1 || '(busiid asc, mobilenbr asc, latest asc, status asc, succnum asc, failnum asc, remarks asc)'; EXECUTE IMMEDIATE D_SQL; EXECUTE IMMEDIATE TABLE_SQL; EXECUTE IMMEDIATE INDEX_1; EXECUTE IMMEDIATE INDEX_2; END P_EXPORTDATA;