可以作为参数传入表名
insert into &tablename values(...);SQL> insert into &tname values(1,'test','新建');
输入 tname 的值:  test
原值    1: insert into &tname values(1,'test','新建')
新值    1: insert into test values(1,'test','新建')已创建 1 行。

解决方案 »

  1.   

    不好意思 我的意思是说:
    有相同结构的表公用一个存储过程来插入数据。
    create procedure DAtaInset(tablename varchar,value1 varchar,value2 varchar)
    is
    begin
        insert into tablename values(value1,value2);
    end DAtaInset;
      

  2.   

    create procedure DAtaInset(tablename varchar,value1 varchar,value2 varchar)
    is
    p_str varhcar2(2000);
    begin
        p_str := 'insert into '||tablename||' values('||value1||','||value2')';
        execute immediate p_str ;
    end DAtaInset;
      

  3.   

    create procedure pro(p_table in varchar2)
    as
    str varchar2(100);
    begin
    str:='insert into '||p_table||'  values(...)';
    execute immediate str;
    end;
    /