2

我有一个“注册”页面,在该页面中我放置了一个提交按钮。单击提交按钮时,如果注册成功,我希望它将页面重定向到“成功”页面。

为了实现这一点,我创建了一个“分支”,其中“分支操作”是一个 PL/SQL 函数体,返回我希望它重定向的页码。函数体是:

if (select count(username) from tuser_info where upper(username) = upper(:p2_username) > 0) 
then return '3';
else return '4';

但是这个块给出了这个错误:

ORA-06550:第 1 行,第 49 列:PLS-00103:在预期以下情况之一时遇到符号“SELECT”:( - + case mod new not null continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date 'a string literal with character set specification' 'a number' 'a single-quoted SQL string' pipe 'analternative-quoted string literal with character set s

谁能帮我解决这个问题???

4

1 回答 1

0

我终于解决了这个问题。

我的 PL/SQL 函数体中有一些错误。它应该是:

declare
    total number;
begin
    total := 0;
    select count(username) into total from tuser_info where upper(username) = upper(:p2_username);
    if (total > 0) then return '3';
    else return '4';
    end if;
end;
于 2017-04-04T12:15:56.973 回答