SQL> create procedure add_customer_info_tab(
  2  param1 in customer_info_tab.customer_id%type,
  3  param2 in customer_info_tab.name%type,
  4  param3 in customer_info_tab.address%type,
  5  param4 in customer_info_tab.code%type,
  6  param5 in customer_info_tab.profession%type,
  7  param6 in customer_info_tab.company%type,
  8  param7 in customer_info_tab.email%type,
  9  param8 in customer_info_tab.phone%type,
 10  param9 in customer_info_tab.mobile%type,
 11  param10 in customer_info_tab.meet_time%type,
 12  param11 in customer_info_tab.memo%type
 13  )as
 14  begin
 15  delete from customer_info_tab where customer_id=param1;
 16  insert into customer_info_tab(customer_id,name,address,code,profession,comp
any,email,phone,mobile,meet_time,memo)values(param1,param2,param3,param4,param5,
,param6,param7,param8,param9,param10,param11);
 17  end;
 18  /
运行时出现“警告: 创建的过程带有编译错误。”
哪位高手能帮忙指点哪里出错了?
谢谢了!

解决方案 »

  1.   

    -- 执行以下口令,贴出来:show errors;
      

  2.   

    第16行
    param5,
    ,param6
    param5和param6之间多了个逗号。。
      

  3.   

    --这里多了个逗号
     16 insert into customer_info_tab(customer_id,name,address,code,profession,comp
    any,email,phone,mobile,meet_time,memo)values(param1,param2,param3,param4,param5,
    ,param6,param7,param8,param9,param10,param11);
    --记得加个commit; 要是设置为自动提交的就不要
      

  4.   

    create or replace procedure add_customer_info_tab(
    param1 in customer_info_tab.customer_id%type,
    param2 in customer_info_tab.name%type,
    param3 in customer_info_tab.address%type,
    param4 in customer_info_tab.code%type,
    param5 in customer_info_tab.profession%type,
    param6 in customer_info_tab.company%type,
    param7 in customer_info_tab.email%type,
    param8 in customer_info_tab.phone%type,
    param9 in customer_info_tab.mobile%type,
    param10 in customer_info_tab.meet_time%type,
    param11 in customer_info_tab.memo%type
    )as
    v_sql VARCHAR2(400):='';
    begin
     delete from customer_info_tab where customer_id=param1;
    v_sql:='insert into customer_info_tab(customer_id,name,address,code,profession,company,email,phone,mobile,meet_time,memo)values(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)';
    EXECUTE IMMEDIATE v_sql USING param1,param2,param3,param4,param5,param6,param7,param8,param9,param10.param11;
    COMMIT;
    end add_customer_info_tab;
    /