写了一个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
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
a_time(1,'我爱小丫头哈哈');
commit;
end;
update article t set t.content=content where t.id=id;因为id = id永远是TRUE(NULL除外),
content=content这个也不更新不了。
所以把存储过程的参数ID改成其他名,比如iID。
SQL> exec a_time(1,'我爱丫头哈哈哈!');
PL/SQL procedure successfully completedbegin
a_time(1,'我爱小丫头哈哈');
commit;
end;
两个都不报错,可就是数据库值没有变。也应该commit了吧,记得mysql中还有设置字符编码,这里是不是因为这个原因?