On Demand Application Processes

Hi,
I was trying to create a report like the one that was posted in the thread Question for Carl Backstro: http://apex.oracle.com/pls/otn/f?p=11933:13.
Except that I had some problems with the creation of on-demand process, because when I go to create it always gives me an error:
"To create an on-demand page process, at least one application level process must be created with the type 'ON-DEMAND'."
I also tried to follow the guide: http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28550/bldr.htm # BABEAIIE
but I could not find a solution.
To start where I put the following string:
http://hostname.com: <port> / pls / apex / f? p = <APP_ID>: <PAGE_ID>: <SESSION_ID>
Thank you in advance.

Hi,
P13_MULTI_0 is the checkbox at the top-left on Carl's page called "Show Multiple". This allows you to click Show Details for more than one row - if this checkbox is not ticked, then when you click on a second "Show Detail" link, the first one is hidden again. If you want to be able to see more than one "Details" at any one time, you would need to include a checkbox like this. If, however, you only really need to see one "Details" at a time, then you can ignore the checkbox and remove this part of the javascript.
For the Ajax part, the three lines that I quoted before:
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=Random_Desc',0);  
get.add('TEMPORARY_ITEM',pID)  
gReturn = get.get();relate to using Ajax to get the "Details" information to display within the report. Ajax is a means of javascript calling a procedure on the server without having to submit the page. On normal HTML pages, this code would be more complicated, but Apex have provided shortcut functions for us to make this easier to use.
The first line prepares the Ajax call - htmldb_Get() is the Apex shortcut function. $x('pFlowId').value is the Application ID for your application. 'APPLICATION_PROCESS=xxxx' is the On Demand application process that you want to call. The last parameter is usually either 0 (zero) or your page number.
The second line is how you can update Application Items with a value that can be used by the Application Process. In this example, there is an Application Item called TEMPORARY_ITEM and it will be set to the value of pID. pID is the ID for the "Show Details" item that has been clicked.
Finally, get.get() is how the Ajax call is actually made and runs the Application Process. The results from the process are stored in the gReturn variable. What you do with gReturn depends on your reason for using Ajax. In Carl's example, we just transfer the entire thing into the new row that is created underneath the current row, by using:
myNewCell.innerHTML = gReturn;"myNewCell.innerHTML" refers to the contents of the TD cell that has been created by the javascript code to show the details.
Andy

Similar Messages

  • How to call an "ON DEMAND" application process

    Dear HTML DB Team,
    With HTML DB you can define "on demand" application processes. ("On Demand: Run this application process when requested by a page process.") These should be callable from page processes.
    How should a call in a page process to such an "on demand process" be written?
    Tried several options, no success. Please help.
    Could not find any information in this forum or html.pdf and help.
    Regards, Erik

    when you create an application-level process in htmldb, you have the option of creating it with a "Point" of "On Demand: Run this application process when requested by a page process". after doing that, you can then add processes to your htmldb application pages with a "Type" of "On Demand - Run an 'on-demand' application process". the next screen after indicating that Type lets you choose the On Demand process you'd like to use.
    hope this helps,
    raj

  • DOC BUG 4.2: About On Demand Application Processes

    There is an error in Oracle Application Express Application Builder User's Guide Release 4.2 §8.8.1 "About On Demand Application Processes":
    An On Demand process is special type of application process which has a Process Point of On Demand and executes when called from a page-level On Demand process or from an AJAX call from the browser. On Demand processes are useful when you have PL/SQL logic that you would like to run from different execution points across multiple pages.
    On Demand processes should typically be created on a page and not at the application-level. On Demand processes created at the application-level are created with an initial authorization scheme of Must Not Be Public User. This prohibits the processes being invoked from users in authenticated sessions.
    As it is perfectly possible (and indeed desirable) for On Demand application processes to be invoked [only] by authenticated users, this should presumably read:
    An On Demand process is special type of application process which has a Process Point of On Demand and executes when called from a page-level On Demand process or from an AJAX call from the browser. On Demand processes are useful when you have PL/SQL logic that you would like to run from different execution points across multiple pages.
    On Demand processes should typically be created on a page and not at the application-level. On Demand processes created at the application-level are created with an initial authorization scheme of Must Not Be Public User. This prohibits the processes being invoked from users in unauthenticated sessions.
    Furthermore, the second paragraph is a new addition to the documentation for APEX 4.2. What is the reasoning for not creating On Demand processes at application level? I have used them for a number of years as a means to provide reusable, application-wide components (for example, file downloads and AJAX content) only to authenticated APEX sessions.

    Hi,
    thanks again. I added a note to the 5.0 docs.
    It is certainly fine to still create application-level On Demand processes. However, if a process is related to a single page only, it is immediately clear that the process is part of this page's interface. This is good from a maintenance point of view, because if you only use app-level processes, it can be harder to determine whether the process is still in use and where it is called from.
    Regards,
    Christian

  • On Demand Application Process not working on IPad or IPhone

    I have application processes that use AJAX to refresh my select list values (see code below). They all work fine on normal devices, but they do not populate at all if I try from an IPad or IPhone. Any ideas?
    HTML Form Element Attributes:
    onactivate="get_select_list_xml1(this,$x('P507_FORMS'),$x('P0_LOGIN_SCHOOL_YEAR'),this,'REFRESH_REPORT_LAYOUT_LOV');" onfocus="if((typeof this.onactivate)!='function'){get_select_list_xml1(this,$x('P507_FORMS'),$x('P0_LOGIN_SCHOOL_YEAR'),this,'REFRESH_REPORT_LAYOUT_LOV');}"
    Application process:
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    FOR c IN (SELECT '2' o, A.report_layout_desc d, A.report_layout r
    FROM form B, report_layout A
    WHERE A.fk_form = B.pk_id and
    B.form = :REFRESH_LOV_PK_ID
    ORDER by 1,2)
    LOOP
    HTP.prn ('<option value="' || c.r || '">' ||
    c.d || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;

    bobmagan wrote:
    It fires on both onactivate and onfocus. I had to do that to work on the Mac clients. Look at the code:
    onactivate="get_select_list_xml1(this,$x('P507_FORMS'),$x('P0_LOGIN_SCHOOL_YEAR'),this,'REFRESH_REPORT_LAYOUT_LOV');" onfocus="if((typeof this.onactivate)!='function'){get_select_list_xml1(this,$x('P507_FORMS'),$x('P0_LOGIN_SCHOOL_YEAR'),this,'REFRESH_REPORT_LAYOUT_LOV');}"What about just
    onfocus="get_select_list_xml1(this, $x('P507_FORMS'), $x'P0_LOGIN_SCHOOL_YEAR'), this, 'REFRESH_REPORT_LAYOUT_LOV');"If not, supply the following information:
    <li>Full APEX version
    <li>Full DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s)/version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/Item type(s)
    and the <tt>get_select_list_xml1</tt> JS code.
    Post code wrapped in tags<tt>\...\</tt> tags to preserve formatting and special characters.

  • How to call an On Demand Application Process on PL/SQL

    Hello
    I need your urgent help. I developed an On Demad Application Process that inserts a new record in a table. Then I need to call that Process from another page after while the user is pressing a button on that page. Do you know the code that does that?
    Thank you very much for your help

    Hi,
    APEX processes are written as anonymous blocks i.e. have no names. Procedures and functions stored in the database must have names. Packages are simply a way of grouping procedures and functions into manageable units. There are also security reasons which are not important for this explanation but use packages instead of stand-alone procedures and functions from the beginning. It is not difficult and it will save you some headaches in the future. Packages have a specification and a body. The specification is basically the interface to the package and the body contains the code. Just basically, no flames please from the PL/SQL gurus out there. The name of a procedure or function and their parameters must be published in the spec for the procedure or function to be called from outside the package.
    Creating a packaged procedure is as simple as this:
    Using SQL Workshop/SQL Scripts, create a script giving it a name like CREATE_MY_PACKAGE
    <pre>
    CREATE OR REPLACE PACKAGE my_package IS
    PROCEDURE helloworld;
    PROCEDURE log_user(p_app_user IN VARCHAR2);
    END my_package;
    CREATE OR REPLACE PACKAGE BODY my_package IS
    PROCEDURE helloworld IS
    BEGIN
    HTP.PRINT('Helloworld');
    END helloworld;
    PROCEDURE log_user(p_app_user IN VARCHAR2) IS
    BEGIN
    INSERT INTO my_table(app_user) VALUES (p_app_user);
    END log_user;
    END my_package;
    </pre>
    You can then, for instance, call procedure helloworld from a PL/SQL region in APEX by simply including
    <pre>
    my_package.helloworld;
    </pre>
    in the region source.
    or you can call procedure log_user from an APEX process by simply including
    <pre>
    my_package.log_user(:APP_USER);
    </pre>
    Important: This explanation is only a brief intro to whet your appetite. It is no substitute for good books including the Oracle PL/SQL Reference.
    Hope this helps;
    Regards Garry
    p.s.
    There are several options available to edit the package or work with DB objects generally. Each with different degrees of comfort.
    1. If you DO NOT have SQL*Net access as with oracle.apex.com then use the Apex/SQL Workshop/Object Browser.
    2. If you DO have SQL*Net access you can use Oracle SQL Developer which is the best free option.
    3. If you DO have SQL*Net access and are not short of cash then use either Toad or SQL Navigator from Quest
    Needless to say, option 3 is the only professional choice. They are amazing tools. No, I did not and do not work for Quest - lol.
    Garry
    Edited by: GarryLawton on Jul 19, 2011 2:08 PM

  • ORA-01403: On Demand Application Process

    Hi
    I have an application process that I pass the customer name into and it returns the SUGGESTED field.
    declare
      l_ID varchar2(100);
    begin
        select distinct SUGGESTED into l_ID from dealers, sr_customers
        where AGREED = 'Y'
        and dealers.CORP_NAME = sr_customers.corp
        and sr_customers.corp = :TEMPORARY_ITEM;
        IF l_ID IS NULL THEN
           htp.prn('NONE');
        ELSE
           htp.prn(l_ID);
        END IF;
    end;The problem I have is when there isn't a record for this customer instead of returning NONE it returns sqlerrm:ORA-01403: no data found
    How can I fix this?
    Regards
    Adam

    Hi Adam,
    Use a cursor instead:
    declare
      l_ID varchar2(100);
      c  SYS_REFCURSOR;
    begin
        OPEN c FOR
                  select distinct SUGGESTED
                  from dealers, sr_customers
                  where AGREED = 'Y'
                  and dealers.CORP_NAME = sr_customers.corp
                  and sr_customers.corp = :TEMPORARY_ITEM;
          FETCH c INTO l_ID; 
          IF c%NOTFOUND THEN
             htp.prn('NONE');
          ELSE 
          htp.prn( l_ID);
        END IF;
    CLOSE c;
    end;
    And it is considered a best practice, to use V('ITEM') in PL/SQL to reference items.
    Bind variable will do just fine..
    Hope it helps,
    Greetings,
    Rutger
    Edited by: Rutger on Oct 8, 2008 7:57 AM
    Edit: Sorry mixed something up, should work now
    Edited by: Rutger on Oct 8, 2008 8:02 AM

  • Populate multi select list  in on demand application process

    Hi all,
    To populate a multi select list we use this code:
    DECLARE
    l_counter number;
    l_o_name varchar2(2000);
    l_val varchar2(100);
    BEGIN
    l_val := wwv_flow.g_x01;
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    FOR rec IN (
    SELECT DISTINCT DECODE(districtscode,NULL,'- Onbekend -',districtscode) as "NAME"
    , DECODE(districtscode,NULL,'-2',districtscode)as "ID"
    FROM table
    WHERE (UPPER(dienstcode) =(l_val)
    or l_val = '-1')
    and objectsubcategorie_id in (select objectsubcategorie_id from table where ind_actief = 'J')
    and ind_uitgesloten is null
    UNION
    SELECT '- Alle districten -', '-1'
    FROM DUAL
    ORDER BY 1
    LOOP
    htp.prn('<option value="' || rec.ID || '">' || rec.NAME
    || '</option>');
    END LOOP;
    htp.prn('</select>');
    END;
    However: L_val is determined by a multiselect list. So, L_id can be: 'A:B:C'. I can convert the value of l_id to 'A','B','C' (with eg replace function). However in a where clause one cannot say: WHERE UPPER(dienstcode) in l_val. So I created a refcursor which I put in a pl/qsl table. Then I looped through the pl/sql table.
    Somehow this did not have the same results. Eventhough the refcursor gave back the same data which I tested by logging the values of the pl/sql table just before the htp.prn command, the htp.prn did not return the values.
    Does anyone know why this happens? Is there a difference between the for loop in this code and looping through a self defined pl/sql table?
    Thanks in advance
    Maurice

    Please, anybody could help me with this?
    Thank you!

  • Display A Success Message From An Application Process

    Apex 3.2
    I have an on demand application process, which is resetting my application, except application items
    BEGIN
       FOR c IN (SELECT page_id
                   FROM apex_application_pages
                  WHERE application_id = :app_id)
       LOOP
          apex_util.clear_page_cache (c.page_id);
       END LOOP;
    :F270_REFRESH_INTERVAL := null;
    END;
    I have a list item that calls some javascript on page zero
    <script type="text/javascript">
    function resetapp(){
    var answer=confirm("Do you really want to reset the application ?");
    if(answer==true) {
    var get = new htmldb_Get(null, null, 'APPLICATION_PROCESS=RESET_APPLICATION');
    var gReturn = get.get();
    redirect('f?p=&APP_ID.:1:&APP_SESSION.');
    </script>
    The user clicks on the item in the list. A confirmation appear and when they click ok,
    then the on demand process runs and they are directed to page 1.
    This is all working ok.
    My problem is that I would like to display a message (a sucesss message) on page 1.
    I have an unconditional branch on page 1 with the tick box checked for include process message.
    I have tried the following in my application process, but none seem to work.
    apex_application.g_print_success_message := 'Application Has Been Reset';
    htp.prn('Application Has Been Reset');
    HTP.P('Application Has Been Reset');
    How can I do this ?
    Gus

    Can anyone help ?
    Gus

  • Progress bar problem in IE with on demand application call

    I have several on demand application processes that I call from javascript. The application processes in turn call pl/sql procedures. Some of the procedures take up to 10 seconds to complete and while they are running, the screen just appears to freeze so the user does not know that they are actually running. I would therefore like to add some kind of a progress bar or hourglass or some indication that things are happening.
    So I found the instructions in Re: Display of Hourglass When Page is processing . This works great in Firefox, but not in IE.
    My Footer text:
    <style> #AjaxLoading{padding:5px;font-size:18px;width:200px;text-align:center;left:50%;top:20%;position:absolute;border:2px solid #666;background-color:#FFF;}
    </style>
    <div id="AjaxLoading" style="display:none;">..Processing..
    <img src="#IMAGE_PREFIX#processing3.gif" id="wait" />
    </div>
    My javascript:
    function create_invoice(pMilestoneNumber){
    var agree=confirm("Are you sure you want to bill this Invoice?");
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=P110_CREATE_INVOICE',$v('pFlowStepId'));
    if (!agree)
         return;
    html_ShowElement('AjaxLoading');
    get.addParam('x01',pMilestoneNumber);
    gReturn = get.get();
    alert(gReturn);
    get = null;
    doSubmit();
    In Firefox, the Progress bar appears immediately after the user clicks ok to the confirm request. In IE, it does not appear until the application process returns with the return message.
    Any help would be greatly appreciated.

    Thanks for your reply. You are right, part of the code got stripped off, I guess I failed to use the code brackets before and after. Here is is again using the code brackets:
    Javascript:
    <script language="JavaScript" type="text/javascript">
    function create_invoice(pMilestoneNumber){
    var agree=confirm("Are you sure you want to bill this Milestone?");
    var get = new
    htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=P110_CREATE_INVOICE',$v('pFlowStepId'));
    if (!agree)
         return;
    html_ShowElement('AjaxLoading');
    get.addParam('x01',pMilestoneNumber);
    gReturn = get.get();
    alert(gReturn);
    get = null;
    doSubmit();
    </script>Footer:
    <style>   #AjaxLoading{padding:5px;font-size:18px;width:200px;text-align:center;left:50%;top:20%;position:absolute;border:2px solid #666;background-color:#FFF;} 
    </style> 
    <div id="AjaxLoading" style="display:none;">..Processing..<br /><img src="#IMAGE_PREFIX#processing3.gif" id="wait" />
    </div>I was using IE8, but I found an another computer with IE7 and I have the same problem there.
    My javascript code throws up a confirm message and as soon as a hit ok, Firefox brings up the progress bar and it stays up until the alert message comes back with the return from the application process. Just the way I want it. In IE, the screen just freezes after I hit ok (the same way as if you don't have a progress bar at all), but then when the alert message comes up with the return from the application process, the progress bar comes up (a little late....).
    Do you have any suggestion as to what my problem may be?

  • Application Processes unique across different schemas?

    I have a test and dev schema on the same server. both sets of code are identical in every way. however when i try and call an on demand application process in dev nothing happens. if i try and call an identical on demand application process on test i get the results i was expecting.
    I changed the name of the application process in dev and i can call it ok. i was just wondering if two on demand application processes can have the same name if they are in different schemas? what else could be causing this issue?
    Thanks
    Tom

    Sorry,
    I copied the wrong code:
    function get_select_list_xml(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SELECT_LIST_D',0);
    get.add('AJAX_ORACLE_JOB_NUM',pThis.value);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    This application process:
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    HTP.prn ('<option value="' || 1 || '">' || '- Stream ID -' || '</option>');
    FOR c IN (
    SELECT DISTINCT b1.STREAM_ID empno , b1.STREAM_ID ename
    FROM BILLINGS b1
    WHERE b1.ORACLE_JOB_NUM = TO_NUMBER(:AJAX_ORACLE_JOB_NUM)
    AND b1.STREAM_ID NOT LIKE ('TWS%E')
    AND b1.STREAM_ID NOT LIKE ('%ERR')
    AND (SELECT COUNT(S.BATCH_ID)
    FROM CHANGE_SITES S
    WHERE (regexp_like(UPPER(nvl(:ajax_site,'%')),(select site_expression from print_sites where upper(print_site_desc) = upper(S.SITE)))
    OR S.SITE IS NULL)
    AND S.ORACLE_JOB_NUM = b1.oracle_job_num
    AND S.STREAM_ID = b1.stream_id
    AND S.BATCH_ID = b1.batch_id) > 0
    UNION
    SELECT DISTINCT STREAM_ID empno , STREAM_ID ename
    FROM BILLINGS b2
    WHERE b2.ORACLE_JOB_NUM = TO_NUMBER(:AJAX_ORACLE_JOB_NUM)
    AND b2.STREAM_ID NOT LIKE ('TWS%E')
    AND b2.STREAM_ID NOT LIKE ('%ERR')
    AND (SELECT COUNT(s2.batch_id)
    FROM change_sites s2
    WHERE S2.ORACLE_JOB_NUM = b2.oracle_job_num
    AND s2.STREAM_ID = b2.stream_id
    AND S2.BATCH_ID = b2.batch_id) = 0
    AND (SELECT COUNT(sv.BATCH_ID)
    FROM SITE_VIEW SV
    WHERE (regexp_like(UPPER(nvl(:ajax_site,'%')),(select site_expression from print_sites where upper(print_site_desc) = upper(Sv.SITE)))
    OR SV.SITE IS NULL)
    AND sv.oracle_job_num = b2.oracle_job_num
    AND sv.stream_id = b2.stream_id
    AND sv.batch_id = b2.batch_id) > 0)
    LOOP
    HTP.prn ('<option value="' || c.empno || '">' || c.ename || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;

  • For Loop with parameter in application process

    Hello,
    I am working on a project for school and a loop in an application process is giving me a headache. I have an application from which I make an ajax call to an "on-demand" process. Here's a short version of the process:
    declare
    valuesList varchar2(32000) := '';
    sqlWhere varchar2(32000) := '';
    begin
    begin
    //calculations, but let's hard code sqlWhere for demonstration purposes
    sqlWhere := ' where ID = 50';
    for j in (select * from myview sqlWhere) loop
    valuesList :=valuesList || '~rowsep~' || j.id || '~colsep~' || j.beds;
    end loop;
         exception
         when no_data_found then null;
         when others then HTP.p('Error: ' || SQLERRM);
    valuesList := substr(valuesList, 9, length(valuesList));
    end;
    htp.prn(valuesList);
    end;
    I thought the for loop would contain only one record but it lists all records in the view. Interestingly, when I replace the loop condition to 'select * from myview where ID = 50' it returns what it's supposed to.
    Could someone please explain what I am doing wrong?
    Thank you!

    There are a couple of different options but using a variable in the sql statement and not the where clause needs an execute immediate. The link below gives a good overview and options to accomplish what you are trying to do.
    execute immediate with for loop
    Edited by: tread on Apr 23, 2012 1:09 PM

  • Can you call a plsql application process from a validation?

    Can you call an on-demand plsql application process from a page validation?
    Thank you,
    Gayle

    Gayle:
    I don't think you can do that. You could consider moving the ODP into the database as a stored procedure . The stored procedure can then be referenced in the ODP and in your validation code as well.
    varad

  • Is it possible to POST data to an application process?

    Hi there,
    I am using Google Gears to implement multiple file upload in Apex 3.2. It is working perfectly except that the uploaded files are inserted in the document table with security_group_id = 0 and are not accessible via the wwv_flow_files view.
    To solve this problem, I am trying to use an application process (so the security context gets set up correctly) but I am getting a 404 error when I try to POST the file to it (using the standard URL format).
    Before I spend more time on this, I would like to ask... Do application processes not like HTTP POSTs and only work with HTTP GETs?
    If that is the case, is there any other option to set up the security context when POSTing data to the Apex DAD?
    Thanks
    Luis

    Hi Luis,
    "on-demand" processes support HTTP POSTs as well. I think you should have a look at the "error.log" file on your web server to find out what's the root cause of your 404 error. Have a look at http://www.inside-oracle-apex.com/oracle-apex-got-404-not-found-2/ for more details.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Is there a problem with APEX Application Processes and VPD?

    I have a table that has a policy function. When I select from the table straight from the page it seems to be only returning the appropriate rows for the user.
    But, when I select from the same table using an application process (On-Demand), PL/SQL Block.
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    FOR c IN (SELECT '1' o,
    name || ' (' || school || ')' d,
    pk_id r
    FROM sch_base
    WHERE pk_id = nvl(:REFRESH_LOV_PK_ID,'null')
    UNION
    SELECT '2' o,
    '%' d,
    '%null%' r
    FROM dual
    UNION
    SELECT '3' o,
    name || ' (' || school || ')' d,
    pk_id r
    FROM sch_base
    WHERE pk_id <> nvl(:REFRESH_LOV_PK_ID,'null')
    ORDER BY 1,2)
    LOOP
    HTP.prn ('<option value="' || c.r || '">' ||
    c.d || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;
    It returns all rows in the table.

    This is the policy on my table:
    begin
    dbms_rls.add_policy(
    object_schema => 'SIS_EXPRESS',
    object_name => 'SCH_BASE',
    policy_name => 'SCH_BASE Policy',
    function_schema => 'SIS_EXPRESS',
    policy_function => 'VPD_SCH_BASE',
    statement_types => 'select');
    end;
    I have a function VPD_SCH_BASE which set the where condition for the SCH_BASE table.
    It works for a simple list values select, but not when this Application Process is run.
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    FOR c IN (SELECT '1' o,
    name || ' (' || school || ')' d,
    pk_id r
    FROM sch_base
    WHERE pk_id = nvl(:REFRESH_LOV_PK_ID,'null')
    UNION
    SELECT '2' o,
    '%' d,
    '%null%' r
    FROM dual
    UNION
    SELECT '3' o,
    name || ' (' || school || ')' d,
    pk_id r
    FROM sch_base
    WHERE pk_id <> nvl(:REFRESH_LOV_PK_ID,'null')
    ORDER BY 1,2)
    LOOP
    HTP.prn ('<option value="' || c.r || '">' ||
    c.d || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;

  • Application Processes

    See http://tinypic.com/m8hh1y.jpg
    This is from the Application Process properties page (4000:4309)
    "No page processes subscribe to this process. However this process may be used by an on-demand process"
    What does this mean?
    1. What does it mean for a page process to "subscribe" to an application process?
    2. How can this application process be "used by an on-demand process"?
    Thanks

    Um, no. I am calling this application process as in
    http://tinypic.com/m8ia07.jpg
    Well that seems strange as far as I know it should show up then.
    Your answer raises more questions!
    What does "calling it from Javascript" mean?as in the htmldb_Get() object and your call an ondemand process
    What does "linking directly to it" mean?as in this example http://htmldb.oracle.com/pls/otn/f?p=11933:25 where I'm using an ondemand process to create the svg graphic.
    f?p=11933:0:493757345324239709:APPLICATION_PROCESS=SVG:NO::SVG_BRANCH_ID,SVG_CHART_NAV:0,YES
    Carl

Maybe you are looking for