This discussion is archived
5 Replies Latest reply: May 16, 2013 2:21 PM by Aljaz RSS

Page Computation Not returning value to page

V Rickert Newbie
Currently Being Moderated
I am trying to get a page computation to work in the rendering phase..
I have set up the computation for After Region and I want it to execute every time someone adds a line of detail to the form. It is a query that returns a single value:

select nvl(sum(inv_det_amount),0) from invoice_details where inv_id = :P320_INV_ID;

THe query runs fine under SQL Workshop/SQL Commands but does not fire on the page.

I have the page item declared as 'sourced' from a 'database column'.
What could I be missing?

The Page Item does contain the correct calculation but it is just not displayed on the screen.

Edited by: V Rickert on May 15, 2013 3:39 PM
  • 1. Re: Page Computation Not returning value to page
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    Create a process with the same point and higher sequence than the fetch process. Put the code in there and it will work.
    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------
  • 2. Re: Page Computation Not returning value to page
    V Rickert Newbie
    Currently Being Moderated
    I am still lost on this. I cannot find any option under the process that will allow me to run the SQL statement and display the value to the screen. THe computation has put the value into my application page item. I just don't know how to get it onto the screen. I am missing something here, I know. :(
    I'm guessing that the calculation is being wiped out by the fetch process?

    Note: Even after fetch process, the calculation is not being displayed in the application page item: P320_INV_TOTAL in the page rendering phase.

    Edited by: V Rickert on May 16, 2013 9:21 AM
  • 3. Re: Page Computation Not returning value to page
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    You can write a process like this:
    BEGIN
       SELECT NVL (SUM (inv_det_amount), 0)
         INTO :p320_your_computed_item
         FROM invoice_details
        WHERE inv_id = :p320_inv_id;
    EXCEPTION
       WHEN OTHERS
       THEN
          NULL;
    END;
    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------
  • 4. Re: Page Computation Not returning value to page
    V Rickert Newbie
    Currently Being Moderated
    Yes, I 've tried that. I guess my computation is set up wrong...I was trying to use PL/SQL page process (under page rendering) but still, even then, it would not set the value on the rendered page at all. So I must not have some switch flipped.
  • 5. Re: Page Computation Not returning value to page
    Aljaz Explorer
    Currently Being Moderated
    Hi,

    >
    I have the page item declared as 'sourced' from a 'database column'.
    >

    What is a setting for Source Used?

    If it is Always, replacing any existing value in session state, then that could explain it.

    That means that first you do your computation or procesess and after that you do reading from database into the item.
    And what you read from database gets into item.

    Regards,
    Aljaz

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points