写了一个procedure:
create or replace procedure a_time(id in article.id%type,content in article.author%type) is
begin
update article t set t.content=content  where t.id=id;
end;
能统计过去,为什么我调用不了?
exec a_time(1,'我爱小丫头哈哈');
commit;
之前是因为没有commit出点问题,现在这我加也还是不行,这是为什么哩?SQL

解决方案 »

  1.   

    最起码commit放在存储过程里面吧,还有输入参数你搞成什么具体的类型看看呢
      

  2.   

    1.最起码你应该说出 报的错误吧?2.如果你是在command窗口调用,应该是没问题的,前提是输入参数没搞错。3.如果 是 sql window 调用,应该写成begin
    a_time(1,'我爱小丫头哈哈');
    commit;
    end;
      

  3.   

    sql-> show error;  看看什么错.....
      

  4.   

    从语法上看,应该是错误的,
    update article t set t.content=content where t.id=id;因为id = id永远是TRUE(NULL除外),
    content=content这个也不更新不了。
    所以把存储过程的参数ID改成其他名,比如iID。
      

  5.   

    这下纠结了,这在command和sql按你说的都不报错,另外我那个id也改成别名了执行如下:
    SQL> exec a_time(1,'我爱丫头哈哈哈!');
     
    PL/SQL procedure successfully completedbegin
     a_time(1,'我爱小丫头哈哈');
    commit;
     end; 
    两个都不报错,可就是数据库值没有变。也应该commit了吧,记得mysql中还有设置字符编码,这里是不是因为这个原因?