【发布时间】:2014-05-12 19:51:42
【问题描述】:
我正在使用 Oracle、PL/SQL。 我写了以下程序:
Declare result number;
countExceed Number;
begin
select count(*) into result from
(select "LoginName","LoginPassword" from "ApplicationUser" where "LoginName"='adin' and "LoginPassword"='admin');
if result>0
then
execute immediate('Update "test" set "Count"=0 where "Count"<5');
dbms_output.put_line('Update as count 0!');
elsif result=0 then
execute immediate(' select "Count"
into countExceed from "test";
if countExceed >5 then
Update "test" set "Count"="Count"+1 where "Count" <5;
END IF;');
dbms_output.put_line('Update as Count + 1!');
End If;
end;
我想做的就是:
检查用户名和密码,如果存在则检查计数5,则更新 Isactive=0。最后 如果用户名和密码不存在,更新 count=count+1 where username=username.
上面的程序给了我这个错误
ORA-00911: 无效字符 请帮忙。
【问题讨论】:
-
问题是什么?还是错误?还是问题?