Dynamic Page in Scripts

Hi,
How can we create dynamic pages(new page) in Scripts?
ie., like I am selecting a new company code, while doing this I need a page to be created dynamically.
Regards,
Renjith MIchael.

Hi,
new page will create in sap scripts using new page command.
you have to set condition like after some number of records displayed in page new page has to be trigger.
ex:YOU HAVE SO MANY RECORDS FOR PRINTING BUT YOU WANT TO DISPLAY 100 RECORDS IN FIRST PAGE REMAINING IN SECOND PAGE LIKE THAT.
Here you can use NEW PAGE COMMAND .
IT IS OPPOSITE PURPOSE OF PROTECT AND ENDPOTECT.
REWARD POINTS.

Similar Messages

  • In a dynamic page how to share variable between PL/SQL and javascript

    For example, my dynamic page contains such PL/SQL codes:
    <ORACLE>
    DECLARE
    info varchar(100);
    rowid urowid;
    procedure doDelete(
    row_id in urowid
    ) IS
    begin
    Delete From xxx
    WHERE rowid = row_id;
    end doDelete;
    BEGIN
    Select name, rowid INTO info, rowid
    From xxx Where xxx;
    HTP.PRN(' <INPUT TYPE="button" VALUE="show value" onClick="alert(info);">');
    HTP.PRN(' <INPUT TYPE="button" VALUE="delete" onClick="doDelete(_row_id);">');
    END;
    </ORACLE>
    The variable 'info' and '_row_id' are correct, however the two HTP. sentence do not work. What's the problem?
    What I want to do is to show all the records in TABLE A in a page. And at the end of each line (record), there' re a 'delete' and a 'update' button to let user operate on this record. Is this possible? I know form can do delete an update, but it can not show all the records in a page like what report does. Besides dynamic page, is there any other better choice? Report can do it?
    One more question. In a report, I employed link on one field to a second report. It works well. But I want to open the second report in a new window when the link is click. Is this possible?
    I was almost driven crazy by these :( I so appreciate if anyone can help.

    The code written by you is insufficient for the funtionality you are trying to achieve. Below is a method to achieve the same.
    Note: Used standard scott.emp table for the example which is located in my db provider schema.
    Do the below modifications as per your local configuration
    xxxxx -> Replace it with your Portal schema
    yyyyy -> Replace it with your db provider schema
    <<module_id_of_form>> -> Replace with the module id of form created in step 1 & 2.
    First and foremost... oracle does not allows variables starting with '_'. So if you want to use it you have to place it in double quotes ("")
    rowid -> illegal
    "_row_id" -> legal.
    However, I will advice you not to use variable names starting with "_".
    Now lets get started...
    1. Create a form on the table you are using in the dynamic page. Just have the update button. Remove the other buttons.
    2. Get the module id of this form. Instruction for getting the module id:
    a) Right-click on the form's run link and copy the shortcut
    b) Get the value of p_moduleid parameter. This is your module id.
    3. Create a procedure "save_action_details" in your db provider schema. This procedure will accomplish the delete operation on the record.
         CREATE OR REPLACE Procedure save_action_details(
         p_rowid IN VARCHAR2,
         p_action IN VARCHAR2,
         p_dyn_ref_path IN VARCHAR2,
         p_dyn_page_url IN VARCHAR2)
         is
         l_sto_session xxxxx.wwsto_api_session;
         begin
         l_sto_session := xxxxx.wwsto_api_session.load_session(
         p_domain => 'DynStore',
         p_sub_domain => 'DynStore_' || p_dyn_ref_path
         l_sto_session.set_attribute(
         p_name => 'rowid',
         p_value => p_rowid
         l_sto_session.set_attribute(
         p_name => 'action',
         p_value => p_action
         l_sto_session.save_session;
         htp.init;
         owa_util.redirect_url(p_dyn_page_url);
         end save_action_details;
    Explaination: The above procedure creates a session and keeps the rowid and action in the session. This information is used by the below dynamic form to perform the necessary action. In our exampl, the action is always going to be delete so you may go ahead and hard code it, else leave it as it is.
    4. Grant execute privilege on the procedure "save_action_details" to public.
    sql> grant execute on save_action_details to public;
    5. Create your Dynamic page.
    a) In HTML code section have the below code. This code shows some columns from the table and "update" and "delete" buttons to perform the respective action.
         <ORACLE>select empno,ename,rowid,
         '<input type="button" value="Update" onClick="doAction(this.form,''UPD'',''xxx'','''
         || xxxxx.wwv_standard_util.url_encode(rowid) || '''); tWin();">
         <input type="button" value="delete" onclick="doAction(this.form,''DEL'',''' || rowid || ''',''xxx'');">' Action
         from yyyyy.emp</ORACLE>
    b) In additional pl/sql code section of dynamic page, have the below pl/sql block "in after displaying the header" section.
         declare
         l_sto_session xxxxx.wwsto_api_session;
         l_del_rowid varchar2(20);
         l_action varchar2(10);
         begin
         htp.comment('User code starts here ...');
         htp.p('<script>');
         htp.p('var winHandle;');
         htp.p('
         function doAction(formObj, action, rowid, erowid)
              if (action == "UPD")
              var formURL = "' || xxxxx.wwctx_api.get_proc_path('wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=<<module_id_of_form>>&p_arg_names=_rowid&p_arg_values=') || '" + erowid;
              winHandle = window.open(formURL, "winDynUpd", "width=750,height=500,resizable=yes");
              else
              formObj.p_rowid.value = rowid;
              formObj.p_action.value = action;
              formObj.submit();
         function tWin() {
              if (winHandle.closed) {
              document.location = document.location;
              else {
              setTimeout("tWin()", 500);
         htp.p('</script>');
         htp.p('<form name="dynRowProcess" method="POST" action="'
         || xxxxx.wwctx_api.get_proc_path('save_action_details','yyyyy')
         || '">');
         htp.p('<input type="hidden" name="p_rowid">');
         htp.p('<input type="hidden" name="p_action">');
         htp.p('<input type="hidden" name="p_dyn_ref_path" value="' || p_reference_path || '">');
         htp.p('<input type="hidden" name="p_dyn_page_url" value="' || p_page_url || '">');
         l_sto_session := xxxxx.wwsto_api_session.load_session(
         p_domain => 'DynStore',
         p_sub_domain => 'DynStore_' || p_reference_path
         l_del_rowid := l_sto_session.get_attribute_as_varchar2('rowid');
         l_action := l_sto_session.get_attribute_as_varchar2('action');
         if l_action = 'DEL' then
         delete from yyyyy.emp
         where rowid = l_del_rowid;
         end if;
         end;
    Explaination: The session information (rowid and action) stored by "save_action_details" procedure is retrieved by the dynamic page and is used to delete the record.
    6. Once you are through with the above steps, test it by placing the above "dynamic page" portlet on a page.
    a) When you click on delete button the record gets deleted and the automatically refreshed page will not show the deleted record.
    b) On clicking update button, a form will appear. do the necessary modifications in data and click update. the data in the form gets updated. Once you close the form the dynamic page gets refreshed automatically and it will show you the updated information.

  • Retrieve data from a dynamic page via loadURL

    Hello.
    I would like to ask you how it is possible to retrieve data
    from a dynamic page (asp classic in my case) using the loadURL
    method.
    I would like to create an html authentication form (with
    username and password fields). The loadURL method should call an
    asp page and then pass to the usual function 'DoIfSucceded' the
    results of the elaboration.
    Of course I'm going to have a switch in the function in order
    to make different actions depending from the results of the asp
    page (authentication succeded or failed).
    I had a look to the examples at this page:
    Adobe
    samples
    Is there anyone who can explain clearly how the results data
    must be written by the asp page and how the success function can
    retrieve them ?
    I thank you in advance for your help.

    loadURL() uses the the XMLHttpRequest Object so if the
    content you return is XML, you have 2 choices for accessing your
    data. You can either access it as a text string via the
    XMLHttpRequest object's responseText property, or as a DOM document
    via the XMLHttpRequest object's responseXML property:
    function MySuccessCallback(req)
    // If my data is XML, I can access the data that was sent
    from the server
    // as DOM elements via the XMLHttpRequest's responseXML
    property.
    var xmlDOM = req.xhRequest.responseXML;
    // OR, you can access the data sent back from the server as
    text via
    // the XMLHttpRequest object's responseText property.
    var xmlAsAString = req.xhRequest.responseText;
    var req = Spry.Utils.loadURL("GET",
    "/app/book.php?id=1&code=54321", true, MySuccessCallback);
    If your serverside script wants to use some other format as a
    response like JSON or plain text, then you can only access the data
    as text via the responseText property.
    --== Kin ==--

  • Using .js file in dynamic page

    In 9.02 i created a portal dynamic page. I would like to include .js file (overlib.js). Can you do this?
    I have tried using the "src=" but it did not work.
    If I try to include the .js code directly in the dynamic page, I get an error. I assume it is a size limitation.
    Help.

    When you say "source=", are you talking about this usage for instance?
    <script type="text/javascript" language="JavaScript1.2"
    src="http://mysite.com/js/myjavascript.js">
    </script>
    Did you get a runtime error after putting that in the dynamic page?

  • Form in Dynamic page not working when checkbox is used.

    I have created a form using dynamic page. The form most have display fields and a checkbox field. When I check a box, it assigns 'Y' value and when unclick, it assign 'N' to the database field.
    When I submit the form, the procedure which is supposed to save the form data never gets executed. Well, at least it says, page not found HTTP 404 error.
    Interestingly if I make this field a text box and manually enter 'Y' or 'N', and then submit the form, the procedure is executed. Data gets saved.
    Is the checkbox not supposed to be used for a database field because checkbox value can be assigned only using javascript and the procedure never get that value ?
    Can you please tell me how to use a checkbox for a database field using dynamic page ?
    thanks,
    Mainak

    Sharmila,
    When I said, the form does not get submitted, I meant that the procedure does not work. The form gets submitted but the procedure does not work. It gives HTTP 404 error. That is what perplexes me. I am unable to understand why the procedure does not work when I click a checkbox.
    May be you can make this work. I am hopeless about this.
    Here is the code for the procedure sumbit_form:
    NOTE: I ADDED TWO FIELDS CALLED PROMOT VARCHAR2(1), PROMOTID NUMBER(4) TO THE EMP TABLE AND CREATED A NEW TABLE CALLED PROMOTEMP. THIS IS A TEST CASE.
    create or replace procedure sumbit_form
    (p_empno IN portal30.wwv_utl_api_types.vc_arr, p_promot IN portal30.wwv_utl_api_types.vc_arr, p_action IN VARCHAR2)
    is
    begin
    if p_action = 'save' then
    for i in 1..p_empno.count LOOP
    update scott.promotemp
    set promot = p_promot(i)
    where empno = p_empno(i);
    END LOOP;
    end if;
    commit;
    htp.p('<b>Saved Successfully</b>');
    htp.p('<table border=1 bordercolor="red">');
    for c1 in (select * from promotemp where promot='Y')
    LOOP
    htp.p('<tr><td>');
    htp.p(c1.ename);
    htp.p('</td><td>');
    htp.p(c1.job);
    htp.p('</td><td>');
    htp.p(c1.mgr);
    htp.p('</td><td>');
    htp.p(c1.sal);
    htp.p('</td><td>');
    htp.p(c1.deptno);
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    EXCEPTION
    when others then
    raise;
    end;
    Here is the code for the dynamic page.
    <HTML>
    <HEAD>
    <TITLE>Promot Emp</TITLE>
    <script language="JavaScript1.1">
    function include(form) {
    var thisform = form;
    for (var i=0; i<thisform.length; i++) {
         if (thisform.elements.type == 'checkbox') {
              if (thisform.elements[i].checked) {
                   thisform.elements[i].value = 'Y'; }
              else { thisform.elements[i].value = 'N'; }
    form.submit();
    function show(form) {
    var thisform = form;
    for (var i=0; i<thisform.length; i++) {
         if (thisform.elements[i].type == 'checkbox') {
              if (thisform.elements[i].value = 'Y') {
                   thisform.elements[i].checked = true; }
              else { thisform.elements[i].checked = false; }
    </script>
    </HEAD>
    <BODY>
    <FORM action="scott.sumbit_form" method="post">
    <table border=1 bordercolor="red">
    <tr>
    <td> </td>
    <td>Name</td>
    <td>Job</td>
    <td>Manager</td>
    <td>Hire Date</td>
    <td>Commission</td>
    <td>Department#</td>
    <td>Include</td>
    </tr>
    <ORACLE>declare
    i number;
    begin
    i := 0;
    for c1 in (select * from scott.promotemp where promotid = :promotid)
    loop
    htp.p('<tr><td>');
    htp.p('<input type="hidden" name="p_empno" value='||c1.empno||'>');
    htp.p('</td><td>');
    htp.p(c1.ename);
    htp.p('</td><td>');
    htp.p(c1.job);
    htp.p('</td><td>');
    htp.p(c1.mgr);
    htp.p('</td><td>');
    htp.p(c1.hiredate);
    htp.p('</td><td>');
    htp.p(c1.comm);
    htp.p('</td><td>');
    htp.p(c1.deptno);
    htp.p('</td><td>');
    if (c1.promot = 'Y') then
    htp.p('<SELECT NAME="p_promot" SIZE="1">
    <OPTION SELECTED VALUE="'||c1.promot||'">Yes
    <OPTION VALUE="N">No
    </SELECT>');
    else
    htp.p('<SELECT NAME="p_promot" SIZE="1">
    <OPTION SELECTED VALUE="'||c1.promot||'">No
    <OPTION VALUE="Y">Yes
    </SELECT>');
    end if;
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    htp.p('<input type="submit" value="save" name="p_action">');
    end;
    </ORACLE>
    </form>
    </BODY>
    </HTML>
    thanks,
    Mainak

  • Dynamic Page that uses javascript to run an executable on the client's pc

    I have an .exe file on a shared network that has to be called and executed from portal. The below code works as standalone but not from a dynamic page or an HTML portlet. Any ideas?
    <html>
    <script language="javascript" type="text/javascript">
    function runApp()
    var shell = new ActiveXObject("WScript.shell");
    shell.run('"c:/CstatsWeeklyreport.exe"',1,true);
    </script>
    <body>
    <input type="button" name="button1" value="Run Notepad" onClick="runApp()" >
    </INPUT>
    </body>
    </html>

    Thanks D, but that's not what I'm looking for. That changes which application a file opens with when you download it. That's not what I need for this situation. Here's a little more detail.
    The clients will have an application on their hard drive; it can be any application, even a custom application that they developed themselves. Then, they open a web page with a listbox full of items. Depending on which item they select, a query will return a file path to the .exe file itself. The .exe file resides on the client's hard drive, not on the server. So they're not downloading anything. Depending on the filepath returned by the query, the browser needs to start the process and open the .exe file for them.
    So let's say I have developed a simple text editor called Tedit. I have a file on my hard drive - "C:\TextEditor\bin\debug\TEdit.exe". When they click the open button, that file path is returned from the database. Then the javascript is called to start the process and open that program.
    Again, nothing is getting downloaded, the application resides on the user's hard drive and there is no file to associate it with.
    This can be done in IE using an ActiveX control. And it used to be possible in Firefox using the nsIFile or nsIProcess objects. But since FF15 that's not available anymore, so the javascript throws an error telling them that their permission is denied.
    What I need, is a javascript that will launch the .exe file from the user's hard drive without downloading anything.

  • How to display dynamic page content in an external application (MS Word)?

    I have a portal that generates a CV from info stored by various forms. The CV displays fine in a dynamic page, but when I add javascript to launch MS Word with a call to the dynamic page portlet, only the hard coded html displays - nothing between the <ORACLE> tags is loaded.
    I had the idea of updating the dynamic page with hard coded html prior to each export - but I can't find where the dynamic page definition is stored in the database.
    Any ideas/better solutions out there?

    dynamic page:
    <ORACLE>
    DECLARE
    theUser varchar2(30) := portal30.COE_GET_CV_PERSON;
    v_output varchar2(6) := portal30.COE_GET_CV_OUTPUT;
    v_no number;
    v_url varchar2(500):= 'http://oraclecoedb.asiapacific.cgey.com:7779/pls/portal30/PORTAL30.wwv_component_control.run_as_portlet?p_module_id=1934976747';
    BEGIN
    IF v_output = 'WORD' THEN htp.script('startWord('||''''||v_url||''''||');','Javascript');
    ELSE null;
    etc ...
    javascript:
    <script language="JavaScript">
    function startWord(strFile)
    var myApp = new ActiveXObject("Word.Application");
    if (myApp != null)
    myApp.Visible = true;
    myApp.Documents.Open(strFile);
    </script>

  • How do i read a context of text file within Dynamic Page of portal ?

    Dear sir,
    I have a text file in client computer. I hope i can transfer the context words of this text file to oracle database. How do i coding this script in dynamic page of portal?
    Can Oaracle 9ias script read and draw the context of a document. Thank you ver much!
    Ghia Liu

    Great questions, Rik, and I understand how this might seem bizarre. Here's the story... these 2500 files were authored with a built-in authoring tool of our current knowledge management system. This KMS is about to be replaced with a new one and because the new KMS needs content within the <head> tag instead of where it was in the <body> tag and redefined as meta data, I repuposed the content in those files using Dreamweaver and regular expressions.  However, the one remaining <h3> and <p> content is in the middle of the newly tagged meta data and it must be moved from the <head> area and into the <body> area.
    Because these were authored in the built-in KMS authoring tool, there is no style sheet and no, we do not manage our content with a CMS.
    You are correct, if the <h3> and <p> were at the end of the data, I could simply move the </head> and <body> tags, but unfortunately that is not the case.  They are consistenly in the same place in all 2500 files, but in the middle of the data. Following is an example:
    <html>
    <head>
    <title>Title here</title>
    <meta name="XYZ" content="Something here...">
    <h3> Blah blah</h3> <p>More blah blah</p>
    <meta name="123" content="More somthing here">
    <meta name="456" content="More somthing here">
    </head>
    <body>
    </body>
    </html>
    Again, I can find the block using a regular expression <h3>(.*?)</p>, but dont know what to do after that.
    I've been told that perl or grep might do the needed task, but that requires outside resources and I have no budget for that.
    Any suggestions are greatly appreciated.
    thanks,
    Rick

  • Dynamic Pages

    Hello to all! Please help me somebody ((. If it's not hard to
    explane me how to script dynamic pages. So i made flash menu then I
    have php page named index.php(with inserted flash menu at the top
    ). When I click on button at the menu all page reloads. But i need
    only to change content that goes under menu. I tried to do it in
    different ways but server side always needs reload. Please help me
    maybe it possible to create something like that using XML. If you
    have some topics or tutorials how to do it. (
    With XML i tried this:
    var my_str = "blabla";
    var my_xml:XML = new XML(my_str);
    my_xml.contentType = "text/xml";
    var receive_xml:XML = new XML();
    recrive_xml.onLoad = function(success){ if(success){
    trace(this.toString()); } else {
    trace("no dat recived"); }}
    my_xml.sendAndLoad("phpscript.php", receive_xml);
    And the server side:
    <?php
    $input = file_get_contents("php://input");
    echo $input;
    ?>
    but nothing....
    Please i need some basic tutorial

    You can have htp calls only within a pl/sql block ie in dynamic pages you do
    <oracle>
    begin
    your pl/sql statement 1;
    your pl/sql statement n;
    end;
    </oracle>
    Eg . This is possible.
    <ORACLE>
    begin
    htp.p('Sunil');
    end;
    </ORACLE>
    You can not call htp.p in a select statement.
    Hope that helps.
    Sunil.
    null

  • Dynamic Pages In Portal

    I am trying to create a dynamic page based on a stored procedure
    which inserts rows into a table. I am having problems changing
    the value of a parameter text box via the following JavaScript.
    <SCRIPT type="text/javascript">
    <!--
    function change_val()
    var rightnow = new Date ();
    execproc.p_curr_values = rightnow.Date()+rightnow.Month()
    +rightnow.Year();
    //-->
    </SCRIPT>
    As you can see from the code below, all the parameters are given
    the same name value (p_curr_values) by Portal (last line of each
    block). This is what throws the Javascript off.
    <INPUT TYPE="hidden" NAME="p_col_displays" VALUE="1">
    <INPUT TYPE="hidden" NAME="p_data_types" VALUE="VARCHAR2">
    <INPUT TYPE="hidden" NAME="p_col_names" VALUE="P_DATA">
    <INPUT TYPE="hidden" NAME="p_in_out" VALUE="IN">
    <TD COLSPAN="1"><INPUT TYPE="text" NAME="p_curr_values" SIZE="2"
    MAXLENGTH="12"></TD>
    <INPUT TYPE="hidden" NAME="p_col_displays" VALUE="2">
    <INPUT TYPE="hidden" NAME="p_data_types" VALUE="VARCHAR2">
    <INPUT TYPE="hidden" NAME="p_col_names" VALUE="P_SURNAME">
    <INPUT TYPE="hidden" NAME="p_in_out" VALUE="IN">
    <TD COLSPAN="1"><INPUT TYPE="text" NAME="p_curr_values"
    SIZE="30" MAXLENGTH="15"></TD>
    <INPUT TYPE="hidden" NAME="p_col_displays" VALUE="3">
    <INPUT TYPE="hidden" NAME="p_data_types" VALUE="DATE">
    <INPUT TYPE="hidden" NAME="p_col_names" VALUE="P_REG">
    <INPUT TYPE="hidden" NAME="p_in_out" VALUE="IN">
    <TD COLSPAN="1"><INPUT TYPE="text" NAME="p_curr_values"
    SIZE="30" MAXLENGTH="9"></TD>
    I tried to change the HTML of the page so that each of the boxes
    may have different names but it does not work. When I save the
    page and run it, the HTML reverts to the default names.
    Does anybody know how to solve this problem?
    I have spend hours on this one and I would really appreciate
    some help.
    Regards,
    Kostas Paschalis

    Hi Debbianna -
    If you are not already a member of Portal Knowledge Exchange ... sign up now - it is free
    http://portalstudio.oracle.com/servlet/page?_pageid=2112&_dad=ops&_schema=OPSTUDIO&_mode=3
    Once you log in, if you do a search on DHTML you will see some samples for dynamic menus. These allow you to download the code as well so you can check out how others have implemented this and possibly just reuse their portlets.
    Hope this helps,
    Candace

  • How do I pass parameters in Dynamic Pages ????!!!!!!

    I have 4 dynamic pages, a user enters in variables on first page. At the next 3 dynamic pages I send the user to I have to display the items they entered on the first page in text items.
    How do I pass these variables ????
    thanks!
    null

    You could use somethings like this:
    <script>
    function setupInventoryReportURL(anchor) {
         var choice = document.getElementById('supplierCenter:inventory:categoryChooser');
         if (choice) {
              var url ='inventoryRPT.jsf' + '?currentCategoryName=' + choice.options[choice.selectedIndex].text;
              anchor.href = url;
         return true;
    </script>
    <h:form id="inventory">
         <h:panelGrid columns="1" border="1" cellpadding="5">
              <f:facet name="header">
                   <h:panelGrid columns="2" width="100%">
                        <h:outputText value="Inventory"/>
                        <h:outputLink value="inventoryRPT.jsf" onclick="setupInventoryReportURL(this)">
                             <h:outputText value="Report" styleClass="commandLink"/>
                        </h:outputLink>
                   </h:panelGrid>
              </f:facet>
    <h:panelGrid columns="2" width="100%">
         <h:panelGroup>
              <h:outputText value="Supply Category"/>
              <h:selectOneMenu id="categoryChooser" value="#{inventory.categoryId}" onchange="submit()"
              valueChangeListener="#{inventoryView.categoryChanged}" immediate="true">
              <f:selectItems value="#{inventory.categories}"/>
         </h:selectOneMenu>
             ..............................................Vladimir Perlov

  • Dynamic page with multiple select in where clause

    Hi,
    I have a dynamic page and in the where-clause, i have a bind variable. In a report i use for instance
    and rtrim((to_char(date_time5,'DAY'))) IN :v_day
    That works ok in a report. But it does not work in a dynamic page.
    what code is needed to work with a multiple select box on the customize screen for a dynamic page?
    Thanks.

    Hi.
    I have a dynamic page, with a bind variable :v_day. On the customization screen the user can select one or more days of the week, or all days. I use this also in a report and then it works ok. In the where clause i use:
    and rtrim((to_char(date_time,'DAY'))) IN :v_day
    Date_time is a tablecolumn (date).
    When i add this line in the select script from the dynamic page, i get error:
    : ORA-06550: line 1, column 2443:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    The symbol "(" was substituted for "" to continue.
    ORA-06550: line 1, column 2606:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( ) , * @ % & - + / at mod rem <an exponent (**)> and or ||
    The symbol ")" was substituted for ";" to continue.
    ORA-06550: line 1, column 3236:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    The symbol (WWV-11230)
    Critical Error in wwerr_api_error.get_errors! SQL Error Message: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-)
    Thanks.

  • Bad performance dynamic page

    Hi.
    Can anybody tell what the bottleneck is in this script? It is a dynamic page (portal 3.0.9). The select statements are not very complicated.
    ANY HELP IS WELCOME!!
    <HTML>
    <BODY BGCOLOR="#FFFFFF" TEXT="#444444">
    <ORACLE>
    declare
    cursor c_runway is select distinct runway from vem_flights where nvl(:v_runway,runway) = runway;
    v_runway vem_flights.runway%type;
    v_select number;
    v_totaal number;
    v_percentage number;
    v_aantal_jaren number;
    v_aantal_maanden number;
    v_aantal_weken number;
    v_aantal_dagen number;
    v_tijd number;
    teller number;
    kopstring varchar2(500);
    selectstring varchar2(500) := '';
    begin
    v_tijd := :v_tijdvak;
    :v_begindate := :v_begindate;
    :v_enddate := :v_enddate;
    if v_tijd = 3 then
    select round(months_between(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS'),to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'))) into v_aantal_maanden from dual;
    if last_day(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')) > add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),v_aantal_maanden) then
    v_aantal_maanden := v_aantal_maanden + 1;
    for teller in 1 .. v_aantal_maanden loop
    if teller = 1 then
    kopstring := '<td><b><i>Baan\Tijdvak </i></b></td>'||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),'DD-MM-YYYY')||' t/m '||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller),'DD-MM-YYYY')||'</i></b></td>';
    elsif teller > 1 and teller < v_aantal_maanden then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1),'DD-MM-YYYY')||' t/m '||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller),'DD-MM-YYYY')||'</b></i></td>';
    elsif teller = v_aantal_maanden then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS'),'DD-MM-YYYY')||'</i></b></td>';
    end if;
    end loop;
    v_aantal_maanden := v_aantal_maanden - 1;
    else
    for teller in 1 .. v_aantal_maanden loop
    if teller = 1 then
    kopstring := '<td><b><i>Baan\Tijdvak </i></b></td>'||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),'DD-MM-YYYY')||' t/m '||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller),'DD-MM-YYYY')||'</i></b></td>';
    elsif teller > 1 and teller < v_aantal_maanden then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1),'DD-MM-YYYY')||' t/m '||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller),'DD-MM-YYYY')||'</b></i></td>';
    elsif teller = v_aantal_maanden then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS'),'DD-MM-YYYY')||'</i></b></td>';     
    end if;
    end loop;
    end if;
    htp.p('<font face = "arial" size="3"><b>Verticale afwijkingen overdag van naderende vliegtuigen buiten de TMA</b></font><p>&nbsp<p>');
    htp.p('<table border="1">');
    htp.p('<tr>'||kopstring||'</tr>');
    open c_runway;
    loop
    fetch c_runway into v_runway;
    exit when c_runway%notfound;
    selectstring := '<td><b><i>'||v_runway||'</i></b>';
    if last_day(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')) > add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),v_aantal_maanden) then
    v_aantal_maanden := v_aantal_maanden + 1;
    for teller in 1 .. v_aantal_maanden loop
    if teller = 1 then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;
    elsif teller > 1 and teller < v_aantal_maanden then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;               
    elsif teller = v_aantal_maanden then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.gs21 = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;               
    end if;
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;
    end loop;
    v_aantal_maanden := v_aantal_maanden - 1;
    else
    for teller in 1 .. v_aantal_maanden loop
    if teller = 1 then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.destination = 'EHAM'
    and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;     
    elsif teller > 1 and teller < v_aantal_maanden then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.destination = 'EHAM'
    and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')
    and add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')-1,teller)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;               
    elsif teller = v_aantal_maanden then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.destination = 'EHAM'
    and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between add_months(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS'),teller-1)
    and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;          
    end if;
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;
    end loop;
    end if;
    htp.p('<tr>'||selectstring||'</tr>');
    end loop;
    close c_runway;
    htp.p('</table>');
    htp.p('</font>');
    elsif v_tijd = 1 then
    select to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS') - to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') into v_aantal_dagen from dual;
    for teller in 0 .. v_aantal_dagen loop
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + teller,'DD-MM-YYYY')||'</b></i></td>';
    end loop;
    htp.p('<font face = "arial" size="3"><b>Verticale afwijkingen overdag van naderende vliegtuigen buiten de TMA</b></font><p>&nbsp<p>');
    htp.p('<table border="1">');
    htp.p('<tr>');
    htp.p('<td><b><i>Baan\Tijdvak </i></b></td>'||kopstring);
    htp.p('</tr>');
    open c_runway;
    loop
    fetch c_runway into v_runway;
    exit when c_runway%notfound;
    selectstring := '<td><b><i>'||v_runway||'</i></b>';
    for teller in 0 .. v_aantal_dagen loop
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time = to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + teller
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.destination = 'EHAM'
    and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time = to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + teller
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;
    end loop;
    htp.p('<tr>'||selectstring||'</tr>');
    end loop;
    close c_runway;
    htp.p('</table>');
    htp.p('</font>');
    elsif v_tijd = 2 then
    select trunc(to_char(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS') - to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')) / 7) into v_aantal_weken from dual;
    for teller in 0 .. v_aantal_weken loop
    if teller < v_aantal_weken then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*14) - 1),'DD-MM-YYYY')||'</b></i></td>';
    elsif teller = v_aantal_weken then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*14) - 1),'DD-MM-YYYY')||'</b></i></td>';
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS'),'DD-MM-YYYY')||'</b></i></td>';                         
    end if;      
    end loop;
    htp.p('<font face = "arial" size="3"><b>Verticale afwijkingen overdag van naderende vliegtuigen buiten de TMA</b></font><p>&nbsp<p>');
    htp.p('<table border="1">');
    htp.p('<tr>');
    htp.p('<td><b><i>Baan\Tijdvak </i></b></td>'||kopstring);
    htp.p('</tr>');
    open c_runway;
    loop
    fetch c_runway into v_runway;
    exit when c_runway%notfound;
    selectstring := '<td><b><i>'||v_runway||'</i></b>';
    for teller in 0 .. v_aantal_weken loop
    if teller < v_aantal_weken then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*14) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);           
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*14) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;
    elsif teller = v_aantal_weken then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*14) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*14) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;          
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;                    
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.gs21      = 'X'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7)
         and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7)
         and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;
    end if;
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;
    end loop;
    htp.p('<tr>'||selectstring||'</tr>');
    end loop;
    close c_runway;
    htp.p('</table>');
    htp.p('</font>');
    elsif v_tijd = 4 then
    select trunc(to_char(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS') - to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS')) / 365) into v_aantal_jaren from dual;
    for teller in 0 .. v_aantal_jaren loop
    if teller < v_aantal_jaren then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*730) - 1),'DD-MM-YYYY')||'</b></i></td>';
    elsif teller = v_aantal_jaren then
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*730) - 1),'DD-MM-YYYY')||'</b></i></td>';
    kopstring := kopstring||'<td colspan="3"><b><i>'||to_char(to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*7),'DD-MM-YYYY')||' t/m '||to_char(to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS'),'DD-MM-YYYY')||'</b></i></td>';                         
    end if;      
    end loop;
    htp.p('<font face = "arial" size="3"><b>Verticale afwijkingen overdag van naderende vliegtuigen buiten de TMA</b></font><p>&nbsp<p>');
    htp.p('<table border="1">');
    htp.p('<tr>');
    htp.p('<td><b><i>Baan\Tijdvak </i></b></td>'||kopstring);
    htp.p('</tr>');
    open c_runway;
    loop
    fetch c_runway into v_runway;
    exit when c_runway%notfound;
    selectstring := '<td><b><i>'||v_runway||'</i></b>';
    for teller in 0 .. v_aantal_jaren loop
    if teller < v_aantal_jaren then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.gs21      = 'X'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*730) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*730) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;
    elsif teller = v_aantal_jaren then
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.gs21      = 'X'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*730) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
         and vem.destination = 'EHAM'
         and vem.period = 'DAY'
    and vem.runway = v_runway
         and vem.departure NOT IN ('EHLE','EHRD','EHVB')
         and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365)
         and to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + ((teller*730) - 1)
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;          
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;                    
    select count(*)
    into v_select
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.gs21      = 'X'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365)
    and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    select count(*)
    into v_totaal
    from vem_flights vem
    where vem.aircrafttype = 'JET'
    and vem.destination = 'EHAM'
    and vem.period = 'DAY'
    and vem.runway = v_runway
    and vem.departure NOT IN ('EHLE','EHRD','EHVB')
    and vem.date_time between to_date(:v_begindate,'DD-MM-YYYY HH24.MI.SS') + (teller*365)
    and to_date(:v_enddate,'DD-MM-YYYY HH24.MI.SS')
    and (rtrim((to_char(vem.date_time,'HH24'))) >= :v_starthour or :v_starthour = '%')
    and (rtrim((to_char(vem.date_time,'HH24'))) < :v_endhour or :v_endhour = '%')
    and rtrim((to_char(vem.date_time,'DAY'))) IN (:v_day);
    if v_totaal != 0 then
    select round((v_select/v_totaal)*100) into v_percentage from dual;
    elsif v_totaal = 0 then
    select 0 into v_percentage from dual;
    end if;
    end if;
    if v_percentage > 5 then
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td><font color="red">'||to_char(v_percentage)||'%</font></td>';
    else
    selectstring := selectstring||'<td>'||to_char(v_select)||'</td><td>'||to_char(v_totaal)||'</td><td>'||to_char(v_percentage)||'%</td>';                    
    end if;
    end loop;
    htp.p('<tr>'||selectstring||'</tr>');
    end loop;
    close c_runway;
    htp.p('</table>');
    htp.p('</font>');
    end if;
    end;
    </ORACLE>
    </BODY>
    </HTML>

    I set up a helper package to return my reference cursors:
    Package SOME_PKG as type t_RefCur is REF CURSOR;
    I added the appropriate function to return the cursors. Here a simple example:
    FUNCTION get_leads(x in NUMBER, y in NUMBER)
    RETURN t_RefCur IS
    v_ReturnCursor t_RefCur;
    v_SQL VARCHAR2(500);
    BEGIN
    v_SQL:= 'select * from SOME_TABLE_OR_VIEW where account = :n and location = :m';
    OPEN v_ReturnCursor FOR v_SQL using x,y;
    RETURN v_ReturnCursor;
    END get_leads;
    Then I make my call from the portlet which goes something like this:
    <oracle>
    declare
    arow SOME_TABLE_OR_VIEW%ROWTYPE;
    invcursor SOME_PKG.t_RefCur;
    X number;
    Y number;
    begin
    invcursor := SOME_PKG.get_leads(get_account_number(X), get_location(Y));
    /*portlet formatting and looping...
    fetch invcursor into arow;
    htp.p(arow.SOME_ROW_FROM_TABLE);
    end;
    </oracle>
    I have gotten very good performance with reference cursors in Oracle.
    Good luck.

  • Dynamic page information from the portal database?

    Is it possible to get information about existing dynamic pages from the portal database? We're upgrading our portal from 9.0.4 to 10.1.4 and because we will be running the new version on a different platform, we can't run any upgrade scripts and need to build again from scratch. I was hoping I could pull dynamic page information from a portal view or table into a spreadsheet, to save our developers having to click into each dynamic page application in the old version to get the pl/sql code to copy and paste into the new version. The generated dynamic page packages just have api calls, so it may be possible that there's an api to do this. Does anyone know if this is possible, and if so, how to do it? Thanks.

    closing the thread

  • Dynamic page problems

    I've recently started to play with applications in 3.0.9.8.1. I've noticed that the option to make a schema an application schema as gone - do we not have to worry about this anymore?
    I created a custom schema and set up the grants etc via the provsyns.sql script. I created a public synonym for my pkg and granted execute on it to PORTAL30_PUBLIC. I then created an application and attempted to create a dynamic page. In the dynamic page I just entered a simple block to call the procedure between the <ORACLE> tags:
    begin
    feedback.home;
    end;
    and clicked on finish. I received the following error:
    110/22 PLS-00302: component 'DYN_08175622' must be declared
    110/13 PL/SQL: Statement ignored
    112/22 PLS-00302: component 'DYN_08175622' must be declared
    112/13 PL/SQL: Statement ignored
    Any ideas as to what is going wrong?

    Just a guess, probably wrong but have you tried
    <jsp:param name="LINK1" value="<%=CertificationProperties.WEB_ROOT%>"view.jsp""/>
    or similar, I am assuming view.jsp is a literal, and should not be within the tags for your variable.

Maybe you are looking for