declare v_sql varchar2(1000);
v_sql:='insert table kkk select  *  from '|| tablename ;
execute v_sql;
请你说具体一点 到底如何使用

解决方案 »

  1.   

    再给你一个
     v_temp_sql:='insert into FUNDRECEVIED_BOOK(fund_code,saler_code,trade_date,recevied_date,bank_code,in_out_type,fund_part,recevied_money, least_money,operation_flag,hand_auto)
                           select t0.fund_code,t0.saler_code,t0.trade_date,:p_account_date,t1.bank_account,t0.in_out_type,t0.fund_part,#1,0,''#2'',''A''
                            from settle_fund t0,par_fund_clearing_bank  t1
                           where t0.hand_auto=''A'' and t0.fund_code=:p_fund_code and t0.trade_date=#3  and #1<>0 and t0.fund_code=t1.fund_code and t1.clearing_kind=''#4'' and t0.saler_code=:p_saler_code and t0.in_out_type=:p_in_out_type';
       v_ins_sql:=replace(v_temp_sql,'#1','t0.bidtotal');
           v_ins_sql:=replace(v_ins_sql,'#2','1');
           v_ins_sql:=replace(v_ins_sql,'#3',v_receive_date);
           v_ins_sql:=replace(v_ins_sql,'#4','1');
           execute immediate v_ins_sql using p_account_date,p_fund_code,v_saler_code,v_in_out_type;
      

  2.   

    create procedure pro(p_col in varchar2,p_tablename in varchar2)
    as
    str varchar2(100);
    begin
    str:='update '||p_tablename||' set '||p_col||'=''1''';
    execute immediate str;
    end;
    /