2017-04-04 6 views
0

「登録」ページがあり、そのページに「送信」ボタンがあります。送信ボタンがクリックされたときに、登録が成功すると、そのページを「成功」ページにリダイレクトする必要があります。Oracle Apex- PL/SQL関数本体に基づく別のページへの分岐

これを達成するために、「ブランチ・アクション」は、リダイレクトするページ番号を戻すPL/SQL関数本体である「ブランチ」を作成しました。 関数本体は次のとおりです。

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

しかし、このブロックは、このエラーを与えている:

ORA-06550: line 1, column 49: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: (- + 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 'an alternatively-quoted string literal with character set s

誰も私がこの問題を解決する助けてもらえます?

答えて

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; 
関連する問題