Sign Up

❇️ OrclQA.Com is a question and answer forum for programmers.
❇️ Here anyone can ask questions and anyone can answer to help others.
❇️ It hardly takes a minute to sign up and it is 100% FREE.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo

OrclQA.Com Navigation

  • Ask Question
  • Write a Tutorial
  • Online Courses
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • Image to Base64
  • PL/SQL Beautifier
  • Ask Question
  • Write a Tutorial
  • Online Courses
Ana
Ana

Ana

  • 23 Questions
  • 31 Answers
  • 0 Best Answers
  • 149 Points
View Profile
  • 0
AnaProfessional
Asked: July 6, 20212021-07-06T16:46:33+05:30 2021-07-06T16:46:33+05:30

Redirect Page by function call in before-header process

  • 0

Hi Sir, I have a question about a function that I call in a before-header process to redirect to the appropriate page.

create or replace function redirect_page(p_user_name in varchar2)

return varchar2

as

v_redirect_url varchar2(100);

branch_page table_1.PAGE%type;

v_state table_1.STATE%type;

v_finalpaper_id table_1.fpid%type;

begin

begin

select fp.state, fp.page,fp.id into v_state, branch_page,v_id

from table_1 fp

left outer join users u on u.uuid=fp.uuid

where lower(u.username)=lower(p_user_name);

if v_state ='REQUESTED'then

v_redirect_url:='f?p=100:95:&APP_SESSION.::NO::P95_ID:'||v_id;

elsif v_state ='APPROVED'then

v_redirect_url:='f?p=100:92:&APP_SESSION.::NO::P92_ID:'||v_id;

end if;
exception

when no_data_found then

v_redirect_url:='f?p=100:1:&APP_SESSION.::NO::';

end;

return v_redirect_url;

end;

Now, when I call the function in the page, I get the 500 Internal Server Error

DECLARE
v_redirect_url VARCHAR2(100);
BEGIN
v_redirect_url:=redirect_page_finalpapers(:session_user_name);
htp.init();
owa_util.redirect_url(v_redirect_url);
apex_application.g_unrecoverable_error := true;
END;

I don't quite understand why this happening and would appreciate some help on here?

apexoracle
  • 4
  • 49
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
Answer
    Advertisement

    4 Answers

    1. apex4ebs

      apex4ebs

      • 4 Questions
      • 5 Answers
      • 0 Best Answers
      • 62 Points
      View Profile
      apex4ebs Professional
      2021-07-10T13:14:49+05:30Added an answer on July 10, 2021 at 1:14 pm

      Are you wanting to redirect to a different page within the same apex application ?

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
      • Ana

        Ana

        • 23 Questions
        • 31 Answers
        • 0 Best Answers
        • 149 Points
        View Profile
        Ana Professional
        2021-07-21T17:38:57+05:30Replied to answer on July 21, 2021 at 5:38 pm

        Yes this is what I want, regarding the state from the table I want to redirect to another page in the same application.

         

        • 0
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
    2. Vinish

      Vinish

      • 1 Question
      • 863 Answers
      • 74 Best Answers
      • 4k Points
      View Profile
      Vinish Enlightened
      2021-07-12T12:14:32+05:30Added an answer on July 12, 2021 at 12:14 pm
      This answer was edited.

      Use branch instead. Check the following post on how to create conditional branches to redirect to a specific page.

      https://www.foxinfotech.in/2021/07/oracle-apex-after-login-redirect-page.html

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
    3. Advertisement
    4. Ana

      Ana

      • 23 Questions
      • 31 Answers
      • 0 Best Answers
      • 149 Points
      View Profile
      Ana Professional
      2021-07-21T17:42:14+05:30Added an answer on July 21, 2021 at 5:42 pm

      I am not quite sure whether this is what fits the best here since my url depends on the state which I retrieve from the table. But in the post, the target page is already set manually...

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter

    You must login to add an answer.

    Forgot Password?

    Advertisement

    Sidebar

    Ask Question
    Write a Tutorial
    Advertisement

    Recent Blog Posts

    • Vinish

      Oracle LENGTH()

    • Vinish

      Oracle INSTR() Function

    • Vinish

      Oracle INITCAP() Function

    • Vinish

      Oracle Concat

    • Vinish

      Oracle CHR Function

    Advertisement
    Advertisement

    Explore

    • Home
    • Blog
    • New Questions
    • Tutorials
      • Oracle
      • Oracle Apex
      • Python
    • Tags
    • Users
    • Badges & Points
    • Image to Base64
    • PL/SQL Beautifier

    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    © 2021 OrclQA.Com. All Rights Reserved.
    Privacy Policy - About Us