Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can I retrieve Table Value and set it into Application Item?

User9999Apr 14 2021

Hello,
I have created a table, in which the state (of processes e.g. 'REQUESTED') and corresponding page is stored with the user.
Now everytime a user logs in, I want him to be redirected to the corresponding page depending on the stored state in the table.
to retrieve the status of a form from the logged in user, I did the following:
- created application item 'STATE_OF_FORM'.
- created application process to set the value into the application item
this takes the status from the table and should set it in the application_item.
Unfortunately it doesn't work as hoped, I think the error is in the syntax:
--this is the code to set stored table status into the status application item

declare
v_state varchar2(50);
begin
select fp.STATE into v_state
FROM PROCESSSTEPS_FORM fp
left outer join USERS u on fp.UUID=u.UUID
where u.username=:APP_USER;
Apex_Util.Set_Session_State('STATE_OF_FORM', v_state);
--exception handling needed otherwise the error 'ORA-01403: no data found' will
exception be raised
when no_data_found then
NULL;
end;

What do I do wrong?
This then I would like to use to redirect the user to the corresponding page with this PL/SQL Statement:

declare
v_state varchar2(50);
v_page number;
begin
 select fp.STATE, fp.PAGE into v_state, v_page from PROCESSSTEPS_FINALPAPERS fp where fp.AUDIT_USER=:APP_USER;
 IF v_state =V('STATE_OF_FORM')
 THEN
SELECT APEX_PAGE.GET_URL (
      p_page  => v_page )
      INTO v_page
   FROM DUAL;
   end if;
end;

But I always get the error , when I try to get to the correspoding page.
wwv_flow.branch_func_returning_url_error
Does the problem lie in my syntax?
Do I work correctly with the Application item and the process?
I am new to APEX and do not quite understand the problem here.

Comments
Post Details
Added on Apr 14 2021
9 comments
1,191 views