Click selectlist item then call a procedure

Hi
Please
Can you advice for click selectlist item then call a procedure?
selectlist-> create dynamic action ->standart->
selection type=items
items= P2_SP
then I am confused .

Did you mean "click" Select list or "change" select list ?
I am guessing that its "change" (click doesn't necessarily change anything in the page)
<li>Create Dynamic Action -> Advanced
<li>Name,Sequence
<li>Event:Change
<li> Selection Type : Item
Item Name
<li>Action : PLSQL
PLSQL Code
BEGIN
  procedure_name(<parameters>);
END;Use the Items to submit field for any item that you use in the PLSQL code.

Similar Messages

  • Calling stored procedure from JSP

    I call a stored procedure from a JSP, but I want to show a page which tells the user that the query is busy executing (it's a big one!) while the stored procedure is executing. I have a page where I select an option, which forwards the request to the JSP that calls the stored procedure. When the procedure has finished, it must forward to a page that tells the user that the procedure executed successfully. The problem I have is that when I select the desired option and click Submit, the next JSP (which should tell the user that the query is executing) doesn't load until after the stored procedure is finished. How can I display this page while the stored procedure is executing?

    The problem I have is that when I select the desired
    option and click Submit, the next JSP (which should
    tell the user that the query is executing) doesn't
    load until after the stored procedure is finished. How
    can I display this page while the stored procedure is
    executing?
    HAve you got the call to the bit that displays the HTML before or after the call to the stored procedure? If it is before then it should display it...not sure if this is the best solution but if you have a .jsp page that first does the html telling the user to wait and then call the procedure should work...

  • Initial error in call to procedure is cached

    Hi,
    I'm running Apex 4.1.0.00.32, with Apex Listener 1.1.3.243.11.40 in WebLogic 10.3.3.0.
    I've noticed that if I run a procedure (/apex/schema.procedure) and the first call is unsuccessful (because of an error in the procedure or lack of privilege), all later calls will also fail.
    Example, create this procedure:
    create or replace procedure bug as
    begin
    htp.p('Hello bug');
    end;
    Try to run it using the url http://<server>/apex/<schema>.bug
    The web page will show just "Not Found". The listener error log will show
    HTTP Status Code: 404 Requested url http://<server>/apex/<schema>.bug is not found.
    The problem now is lack of grant. So, do a "grant execute on bug to apex_public_user;".
    Refresh the web page but "Not Found" persists.
    There are now two options:
    - change the url to (for instance) http://<server>/apex/<schema>.Bug (ie change case)
    - restart the whole weblogic server (stopping the Apex deployment is not possible)
    As changing the case of the url is not practical if the application is generating links, a restart is the option left.
    Is this "caching" of initial failure the expected behaviour or have I missed some configuration?
    I have no caching enabled in the listener.
    Kind regards
    Tomas Albinsson
    Stockholm, Sweden

    why would the listener look up metadata for the procedure to call?
    Either the user has the correct procedure name and parameter names - the call succeeds.
    Or the name or some parameter is wrong - the call fails and is reported to the user.Hi Tomas,
    Let me just repeat again that I don't know exactly how the Apex Listener implements its database calls.
    My comments are based on my own experiences from writing the Thoth Gateway, which essentially does the same thing as mod_plsql and the Apex Listener, except it is written in .NET and runs on Microsoft IIS. See http://code.google.com/p/thoth-gateway/ for more details.
    One reason for caching the procedure metadata is this:
    Let's say you have a procedure with a parameter which is a "table of varchar2" (such as the f01, f02, etc. parameters in the "wwv_flow.accept" procedure in Apex). These can accept zero, one or more values, depending on how many times you have repeated that input element name on the HTML page.
    So the Listener receives a call for the "wwv_flow.accept" procedure with a single value for the "f01" parameter. Without looking in the data dictionary (see DBA_ARGUMENTS), there is no way the Listener can know that the f01 parameter is actually a "table of varchar2" (and needs to be bound as that datatype when invoking the stored procedure). If the value is bound as a string (plain varchar2) parameter, the procedure call fails.
    Now, there are at least two ways to handle this: You can either catch the error, assume it was really a "table of varchar2" parameter, and try again with that; or you can look it up in the data dictionary beforehand to avoid the error. In either case, it's not good for performance to do this for every procedure call.
    The Thoth Gateway actually works this way: It first checks whether it has cached metadata for the procedure. If not, it tries to call the procedure based on just the names and values. If this fails, it silently catches the error and then looks up the procedure metadata from the data dictionary to make sure the parameter types are correct. It then calls the procedure again (and hopefully that should be successful). Then the metadata is cached. Which means that any subsequent invocations of the same procedure don't need to go through the same work again.
    Looking up (and caching) the metadata also has another benefit: If there are input elements on the HTML page that do not correspond to parameter names in the procedure (perhaps some client-side JS framework added some input fields dynamically), then the procedure call would fail. You can see this in action using mod_plsql and DBMS_EPG (you get an error along the lines of "arguments in form not in procedure..."). However, the Thoth Gateway (and I believe also the Apex Listener) checks the incoming parameter names against the metadata, and just discards any parameter names/values that are not in the procedure.
    - Morten
    http://ora-00001.blogspot.com
    Edited by: mobra on Oct 20, 2011 10:52 AM

  • Assigned To column (or any column that uses People Picker) cleared after clicking Edit Item in a Task List

    Our SharePoint Foundation 2013 is experiencing a weird issue. It only happens in Task Lists. For example:
    Create a new Task in Task List and fill the Assigned To field with a user from the People Picker list. The People Picker works fine as all users in Active Directory are appearing.
    Save Task.
    Edit Item the task that was just created.
    The Assigned To field is now cleared for that Task.
    It used to keep the user that was in the Assigned To column.
    Are there any suggestions on what may have caused this or what I can try to fix this?
    This was after some Windows updates were installed end of August.

    Hi PauIT,
    According to your post, my understanding is that the “Assigned To” field is cleared when you edit a task item in the Tasks List.
    I recommend that you can enable server rendering on the list view Web Part for the Tasks List to solve this issue.
    To do this, please follow the steps as below:
    Open the Tasks List in your site, add a new task item, type the user name in the “Assign To” field and save it.
    Select the new item, click “Edit item”, then go to the Gear icon, click “Edit page”, click the drop-down arrow in the upper-right corner of the Web Part for the Tasks List, and click “Edit Web Part”.
    On the right side of the page in the Web Part properties controls, click the plus sign (+) on the “Miscellaneous” section, select the “Server Render” in the “CSS Render Mode” section, then click “Apply”, “OK” and save the changes of the page.
    Then, you can see if the “Assign To” field in the new item’s Edit Form has the corresponding values.
    There are some similar threads for your reference:
    http://sharepoint.stackexchange.com/questions/87089/assigned-to-column-text-hidden-but-filterable
    http://support.microsoft.com/kb/2924913/en-us
    Best Regards,
    Yumi Fu

  • Calling a Procedure an this return a Cursor......

    i have a package with a procedure like this
    PACKAGE PKG_TEST IS
    TYPE data_cursor IS REF CURSOR;
    PROCEDURE PRC_GET_DATA( VAR_ONE IN VARCHAR2, IO_CURSOR OUT data_cursor ) ;
    END ;
    PACKAGE BODY PKG_TEST IS
    PROCEDURE PRC_GET_DATA( VAR_ONE IN VARCHAR2, IO_CURSOR OUT data_cursor ) IS
    MENSAJE VARCHAR2(1000);
    CURSOR_AUX DATA_CURSOR;
    ERR_NUM NUMBER;
    ERR_MSG VARCHAR2(100);
    BEGIN
    OPEN CURSOR_AUX FOR
    SELECT ATTRIB1, ATRIB2 FROM TABLE WHERE (CODITION);
    IO_CURSOR := CURSOR_AUX;
    END PRC_GET_DATA;
    END;
    and, i have some troubles to call from JSP page...
    the java Source is
    Connection conn = source.getConnection();
    Statment stmt = conn.createStatment();
    CallableStatment cs = conn.prepareCall( {CALL PKG_TEST.PRC_GET_DATA( '%') } );
    ResultSet rset = cs.executeQuery();
    Some can help me?....

    You must register the input/output parameters like this and then call stored procedure/function
    CallableStatement cstStat = this.con.prepareCall("{? = call some_package.some_function(?) }");
    cstStat.registerOutParameter(1, java.sql.Types.VARCHAR);
    cstStat.setString(2, Name);
    int res = cstStat.executeUpdate();
    String outParam = cstStat.getString(1);

  • Two related questions: using htmldb_Get to call stored procedure and passing in an array of items

    I have the need to save dynamically generated ApEx items via AJAX.  I am using APEX_ITEM API to generate the items.  At run-time, I have no idea how many of items will be generated on the page, but I know that they will all have discreet and distinct "name" attributes, i.e. f01, f02, f03, etc.  As a basic example, if I have to generate a select list, I know that the "p_idx" parameter of the APEX_ITEM call is say "3", so all select lists that get generated will have a "name" attribute in the DOM of "f03", all text items will be "f01", etc.
    I want to save this data to the database via AJAX.  It is typical to call the standard htmldb_Get javascript function for use of an on-demand process, but I am interested in using the rarely-called-upon "procedure" and queryString" options of that javascript function so that I can build the queryString on the fly based on what is on the DOM when the tries to save the data they entered into these APEX_ITEM-generated items.  Does anyone have any good examples of how to use the "procedure" and "queryString" parameters of the htmldb_Get javascript function?
    I have found a smattering of some blogs, posts, etc. online related to this, but mostly just people regurgitating the documentation.  I found this post (https://forums.oracle.com/thread/2549237) which had a glimpse of hope to be able to pass an array (which is something I will need) as a parameter, but would like someone to sanity check this before I go down that road.
    Shane.
    ApEx 4.2.1

    Shane
    Since you mention you are on APEX 4.2  I would recommend using apex.server.process which is the documented replacement of the officially undocumented htmldb_Get.
    In the documentation it is set that the first parameter is the ajaxidentifier but it actually is the process name.
    The data object would be something like
    var lData ={f01 : get_value_array('f01')}
    Where get_value_array is
    function get_value_array(pColumnName) {
      var l_values =[];
      apex.jQuery('[name="'+pColumnName+'"]').each(
       function(){
        var l_value;
        l_value = apex.item(this.id).getValue();
        l_values.push(l_value);
      return l_values
    For a working example see this demo.
    Nicolette

  • Calling Stored Procedure by clicking a button.

    Hi,
    I am developing an application using Oracle JHeadstart 10.1.3 Preview Version 10.1.3.0.78
    I want to call Stored Procedure using a parameter from a jspx page.
    In a jspx page I want to put a button. When the button will be clicked, it will send the ID as a parameter and call the Stored Procedure using that parameter.
    Can anybody tell me how I can do this?
    Your help would be very much appreciated.
    Thanks
    Syed

    Hi Eduardo or Steven,
    Could you please help me explaining how to put the method I created in an ADF Faces page as button.
    I draged and droped the method in the ADF Faces page and it is giving me an error:
    500 Internal Server Error
    javax.faces.el.PropertyNotFoundException: Error testing property 'inputValue' in bean of type null     at com.sun.faces.el.PropertyResolverImpl.isReadOnly(PropertyResolverImpl.java:254)     at oracle.adfinternal.view.faces.model.FacesPropertyResolver.isReadOnly(FacesPropertyResolver.java:124)     at com.sun.faces.el.impl.ArraySuffix.isReadOnly(ArraySuffix.java:216)     at com.sun.faces.el.impl.ComplexValue.isReadOnly(ComplexValue.java:189)     at com.sun.faces.el.ValueBindingImpl.isReadOnly(ValueBindingImpl.java:293)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:211)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.FormElementRenderer.renderAsElement(FormElementRenderer.java:155)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.InputLabelAndMessageRenderer.getLabelFor(InputLabelAndMessageRenderer.java:53)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.LabelAndMessageRenderer$Label.getForId(LabelAndMessageRenderer.java:500)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.OutputLabelRenderer.encodeAll(OutputLabelRenderer.java:69)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.delegateRenderer(CoreRenderer.java:271)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.LabelAndMessageRenderer._renderLabelCell(LabelAndMessageRenderer.java:222)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.LabelAndMessageRenderer.encodeAll(LabelAndMessageRenderer.java:159)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.InputLabelAndMessageRenderer.encodeAll(InputLabelAndMessageRenderer.java:94)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:236)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer.encodeColumnChild(PanelFormRenderer.java:275)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer.renderColumn(PanelFormRenderer.java:251)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer._renderColumns(PanelFormRenderer.java:545)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer._encodeChildren(PanelFormRenderer.java:153)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer.encodeAll(PanelFormRenderer.java:69)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:236)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer._encodeChild(PanelGroupRenderer.java:147)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer._encodeChildren(PanelGroupRenderer.java:124)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer.encodeAll(PanelGroupRenderer.java:72)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:236)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer._encodeChild(PanelGroupRenderer.java:147)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer._encodeChildren(PanelGroupRenderer.java:124)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelGroupRenderer.encodeAll(PanelGroupRenderer.java:72)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:317)     at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262)     at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:240)     at oracle.adfinternal.view.faces.ui.composite.ContextPoppingUINode$ContextPoppingRenderer.render(ContextPoppingUINode.java:224)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:412)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:330)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:222)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer.java:129)     at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:412)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:330)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:222)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer.java:129)     at oracle.adfinternal.view.faces.ui.laf.oracle.desktop.HeaderRenderer.renderContent(HeaderRenderer.java:482)     at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:412)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:330)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:222)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer.java:129)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.BorderLayoutRenderer.renderIndexedChildren(BorderLayoutRenderer.java:43)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.BorderLayoutRenderer.renderContent(BorderLayoutRenderer.java:71)     at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:412)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:330)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:222)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer.java:129)     at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.composite.UINodeRenderer.renderWithNode(UINodeRenderer.java:90)     at oracle.adfinternal.view.faces.ui.composite.UINodeRenderer.render(UINodeRenderer.java:39)     at oracle.adfinternal.view.faces.ui.laf.oracle.desktop.PageLayoutRenderer.render(PageLayoutRenderer.java:78)     at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177)     at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.renderkit.RenderUtils.encodeRecursive(RenderUtils.java:54)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:232)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeAllChildren(CoreRenderer.java:255)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:66)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:117)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:147)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:60)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:623)     at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:546)     at oracle.adf.view.faces.webapp.UIXComponentTag.doEndTag(UIXComponentTag.java:100)     at web2d_inf._page._Dsperson__to__EntryInfo___jspx._jspService(_Dsperson__to__EntryInfo___jspx.java:804)     [WEB-INF/page/Dsperson_to_EntryInfo_.jspx]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:298)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:205)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)     at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)     at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    I would appreciate your help regarding this.
    Thanks
    Syed

  • How to pass item value when call a procedure

    Hi,
    I tried to display a blob image by calling a procedure,
    it's work if I hardcode the parameter, eg <img src="#OWNER#.download_my_file?p_id=1&p_picture=1" height=60 width=40 /img>
    but if I pass the p_id value with some page item value <img src="#OWNER#.download_my_file?p_id=:P_ITEM_ID.&p_picture=1" height=60 width=40 /img>
    the image don't display...is there anything wrong with my syntax?
    Thanks
    Vincent

    Vincent,
    The &P_ITEM_ID. must be in uppercase?Yes, exactly like I showed. Substitutions strings in Application Express must always be in upper case, no exceptions.
    Scott

  • Dangers of calling restricted procedures from when-validate-item

    As you'll all know, you cannot call the restricted procedure go_item from within the when-validate-item trigger.
    I've read that it is possible to get round this utilising timers, and I have managed to get this working.
    However, I cannot help but think such procedures must be restricted for a reason. Therefore, I'd like to know if there are any known problems that might arise from implementing timers to call restricted procedures?
    Thanks
    Matthew

    Certain types of triggers can't call restricted procedures because there is internal navigation or validation going on during the trigger execution, and the restricted procedures could mess that up. However, when you use a timer, the restricted procedure doesn't execute until after the trigger has finished, so the internal navigation/validation is complete. Because of this, the timer technique is a safe one. If it's a non-repeating timer, it should have very little effect on network traffic and performance.

  • Calling a Procedure from a Button? (REVISITED)

    Hi All,
    I once asked a question Re: Calling a Procedure from a Button? & that problem was resolved when i was working on the online ApEx.
    On my application, requirements have changed a bit: I have one form based on two tables. One table contributes two fields (name & surname) to the form while the remaining fields are contributed by another table to make a total of 17 fields on the form.
    My process is in such a way that a user enters an id number & clicks Search button, if the apllicant exists then both name & surname corresponding with the id number will be retrieved from the database. If the applicant does not exist then an error message will be displayed inline with the id number field. Here's the PL/SQL anonymous block to that:
    DECLARE
    vNAME APPLICANTS.name%TYPE;
    vSURNAME APPLICANTS.surname%TYPE;
    BEGIN
    SELECT count(*)
    INTO :P2_COUNT
    FROM applicants
    WHERE id_number = :P2_ID_NUMBER;
    IF :P2_COUNT > 0 THEN
    SELECT name,surname
    INTO vNAME, vSURNAME
    FROM applicants
    WHERE id_number = :P2_ID_NUMBER;
    :P2_NAME := vNAME;
    :P2_SURNAME := vSURNAME;
    ELSE
    apex_application.g_print_success_message := '<span style="color:red">Applicant does not exist.</span>';
    END IF;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    apex_application.g_print_success_message := '<span style="color:red">Exception Caught.</span>';
    END;The PL/SQL block works except for error displaying part (but that's a problem for another day).
    NB: On my application, there’s already Automated Row Fetch & Automatic Row Processing (DML) processes for one table. Furthermore, there is also a javascript for verifying the validity of an id number. As a result, I decided to include Automated Row Fetch & Automatic Row Processing (DML) processes for the other table. When I click a Search button the javascript is activated even though I did not specify a URL target for the button - because this is a simple button among region items – it does not have Optional Url Redirect section.
    I'm not sure what I'm doing wrong here - any help is appreciated.
    Regards
    Kamo

    Hi Dan,
    Sorry for causing confusion with my post - it's just that I was asking the same question (with different constraints) as I had asked before so I didn't feel like going to details was necessary because in my post I included a link to the previous thread. Interestingly, I was working on apex.oracle.com when I posted the original thread - the only problem came to be when I started to move the solution to my application on my machine.
    Anyway, thanks for the response!
    Regards
    Kamo

  • Need sample source code for calling stored procedure in Oracle

    Hi.
    I try to call stored procedure in oracle using JCA JDBC.
    Anybody have sample source code for that ?
    Regards, Arnold.

    Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
    I have the Procedure defined as below in the SFCS1 package body
    Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
    BEGIN
    Open O_Cursor FOR
    SELECT CompanyId, CompanyName
    FROM Company
    WHERE CompanyProvince IN ('AL','AK');
    END Company_Selection;
    In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
    At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
    DECLARE
    A SFCS1.T_Cursor;
    BEGIN
    SFCS1.Company_Selection(A);
    go_Block ('Block36');
    The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause.

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • Calling stored procedure from BC4J

    How can I call a stored procedure in a JSP using the BC4J framework?
    null

    Vitor,
    Basically, you need to create a custom method from your JSP's ViewObject, which calls the stored procedure. You can then call the ViewObject's custom method from the JSP client.
    Here is how I have done it:
    1. Choose the ViewObject that your JSP is based on and choose 'Edit' from the context menu.
    2. On the Java tab of the ViewObject wizard, choose Generate Java File checkbox for the View Object Class and click the Finish button. A file is created under the ViewObject node in the Navigator named 'viewobjectImpl.java'.
    3. Open the viewobjectImpl.java file in the code editor and create a method to call your stored procedure (see sample code below).
    4. Compile the VOImpl.java file.
    5. Choose the view object again, and choose Edit again from the context menu.
    6. On the Client Methods tab, you should now see your method appear in the Available field. Select it and shuttle it to the Selected field.
    7. Click Finish to leave the VO wizard, and rebuild your Business Components project.
    8. In your JSP, call the custom method (see sample code below).
    sample code for custom method calling a stored procedure from VOImpl.java file:
    public int getTotalHits(String mon, String year) {
    CallableStatement stmt = null;
    int total;
    // the call to the PL/SQL stored proc
    String totalhits = "{? = call walkthru.total_hits(?,?)}";
    // use the AM conxn 2 call storedproc
    stmt = getDBTransaction().createCallableStatement(totalhits, 1);
    try
    // Bind the Statement Parameters and Execute this Statement
    stmt.registerOutParameter(1,Types.INTEGER);
    stmt.setString(2,mon);
    stmt.setString(3,year);
    stmt.execute();
    total = stmt.getInt(1);
    catch (Exception ex)
    throw new oracle.jbo.JboException(ex);
    finally
    try
    stmt.close();
    catch (Exception nex)
    return total;
    sample render code for calling custom method from JSP custom bean:
    public void render() {
    int totalhits;
    try
    Row[] rows;
    // Retrieve all records by default, the qView variable is defined in the base class
    qView.setRangeSize(-1);
    qView.first();
    rows = qView.getAllRowsInRange();
    // instantiate a view object for our exported method
    // and call the stored procedure to get the total
    ViewObject vo = qView.getViewObject();
    wtQueryView theView = (wtQueryView) vo;
    totalhits = theView.getTotalHits(session.getValue("m").toString(),session.getValue("y").toString());
    out.println(totalhits);
    } catch(Exception ex)
    throw new RuntimeException(ex.getMessage());
    null

  • Calling a Procedure and Variables with a : vs. a ?

    Sorry, this is a long one, but I'm trying to provide as much background as possible.
    The below code (from a procedure called view_ibba_for_maint) is a snippet of code from a much larger SQL package. The package is called from a web browser.
    htp.tableOpen('CELLSPACING=1 CELLPADDING=1 width="50%"
    bordercolor="#669966"', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    *'nfdw_budadmn.del_ibba_warn:2'||'fyear='||fyear||'&'||*
    *'budorg='||budorg||'&'||'appr_unit='||appr_unit||'&'||*
    *'obje_ocat='||obje_ocat||'&'||*
    *'bud_auth_amount='||bud_auth_amount||'&'||*
    *'appr_name='||appr_name||'&'||*
    *'fy_id='||fycode||'&'||*
    *'borg_id='||borg_id||'&'||*
    *'appr_id='||appr_id||'&'||*
    *'obje_id='||obje_id||*
    *'"onMouseOver=" window.status=''Click to Remove IBBA Budget Line.'';*
    return true','Remove Budget'),calign=>'CENTER');
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    *'nfdw_budadmn.mod_ibba_inp'||*
    *'"onMouseOver=" window.status=''Click to Return to Query Form.'';*
    return true','Return To Query Form'),calign=>'CENTER');
    htp.tableRowClose;
    htp.tableClose;
    This portion of code calls a procedure called del_ibba_warn (in the nfdw_budadmn package). Both procedures are in the nfdw_budadmn package. view_ibba_for_maint calls del_ibba_warn a few times in the procedure. Anyway, when we were on Oracle 8i, the package and procedures worked fine. However, when we upgraded to 10g, it fails. (see the following web_browser link and error that is generated)
    Internet Explorer Address Bar:     http://orasrv2/fdotdwat/nfdw_budadmn.del_ibba_warn:2fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount=0&appr_name=INFORMATION%20SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968
    Error:
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /fdotdwat/nfdw_budadmn.del_ibba_warn:2fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount=0&appr_name=INFORMATION SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968 HTTP-400 Name "nfdw_budadmn.del_ibba_warn:2fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount=0&appr_name=INFORMATION SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968" is longer than 30 chars
    We believe it is a problem with the way del_ibba_warn is called. In the original code it is called like this: 'nfdw_budadmn.del_ibba_warn:2'. So I try to replace the :2 with a ? (like this: 'nfdw_budadmn.del_ibba_warn?' (also tried nfdw_budadmn.del_ibba_warn?2'), but it still fails. The program actually replaces the new ? that I put into the code with a :1 in the internet explorer address bar when I run it.. (Not sure why a :1 and not a :2.) But, if I go and substitute the :1 with a ? in the address bar that is generated after I attempt to call the procedure, it works. I change the address bar to this:
    http://orasrv2/fdotdwat/nfdw_budadmn.del_ibba_warn?fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount= 0&appr_name=INFORMATION%20SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968
    Hit enter, and the procedure goes forward like it should. So, the overall question is why is the IE address bar forcing the :2 or :1 to show up in the address bar? Why won't it take my ? I put in? Why was it necessary for the original programer to label the del_ibba_warn calls with a : or a :2 at all? (Again, del_ibba_warn is called a few times in the procedure). And, it used to work when we were on 8i.
    We have been trying to figure this out (on and off) for some time now. We feel like we're right there for figuring this out, but can't quite get it. Any ideas? Please let me know if I can provide any additional info. Thanks!

    Darn, didn't work. I still get the same error.......
    The address bar:
    http://orasrv2/fdotdwat/nfdw_budadmn.del_ibba_warn:2fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount=0&appr_name=INFORMATION%20SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968
    The Error:
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /fdotdwat/nfdw_budadmn.del_ibba_warn:2fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount=0&appr_name=INFORMATION SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968 HTTP-400 Name "nfdw_budadmn.del_ibba_warn:2fyear=2008&budorg=B065&appr_unit=466026&obje_ocat=8130&bud_auth_amount=0&appr_name=INFORMATION SERVICES&fy_id=6497&borg_id=65775&appr_id=263566&obje_id=23968" is longer than 30 chars
    Now, I pasted the changes you suggested and the package did compile. But notice how it forces the ":2" into the address bar and the error message? That, I just don't get. Would it help if I posted the two procedures involved? I'll avoid posting the whole package (it's way big).
    Here are the two procedures involved.
    view_ibba_for_maint (before I made your suggested changes) & del_ibba_warn
    procedure view_ibba_for_maint(
    fyear IN VARCHAR2,
    budorg IN VARCHAR2,
    appr_unit IN VARCHAR2,
    obje_ocat IN VARCHAR2,
    password IN VARCHAR2)
    IS
    CURSOR c1 (c1_fyr_id IN NUMBER,
    c1_borg_id IN NUMBER,
    c1_appr_id IN NUMBER,
    c1_obje_id IN NUMBER,
    c1_fmonth IN NUMBER) IS
    select appr_budget_account_code, appr_budget_account_category, appr_name,
    orga_organization, obje_object_code, ibba_budget_authorized_amount
    from internal_budget_balances, appropriations, organizations, objects
    where ibba_fiscal_year_code = c1_fyr_id
    and ibba_fiscal_month_code = c1_fmonth
    and ibba_organization_id = c1_borg_id
    and orga_organization_id = ibba_organization_id
    and ibba_appropriation_id = c1_appr_id
    and appr_appropriation_id = ibba_appropriation_id
    and ibba_object_id = c1_obje_id
    and obje_object_id = ibba_object_id
    order by orga_organization,
    appr_budget_account_code||appr_budget_account_category,
    obje_object_code;
    CURSOR c2 (c2_fyr_id IN NUMBER,
    c2_borg_id IN NUMBER,
    c2_appr_id IN NUMBER,
    c2_ocat IN VARCHAR2,
    c2_fmonth IN NUMBER) IS
    select appr_budget_account_code, appr_budget_account_category, appr_name,
    orga_organization, ibba_budget_authorized_amount,
    ibba_object_category
    from internal_budget_balances, appropriations, organizations
    where ibba_fiscal_year_code = c2_fyr_id
    and ibba_fiscal_month_code = c2_fmonth
    and ibba_organization_id = c2_borg_id
    and orga_organization_id = ibba_organization_id
    and ibba_appropriation_id = c2_appr_id
    and appr_appropriation_id = ibba_appropriation_id
    and ibba_object_category = c2_ocat
    order by orga_organization,
    appr_budget_account_code||appr_budget_account_category,
    ibba_object_category;
    p_app VARCHAR2(40) :='nfdw_budadmn.mod_ibba_inp';
    c1_rec c1%ROWTYPE;
    c2_rec c2%ROWTYPE;
    dh_aelg_rec application_error_log%ROWTYPE;
    its_an_obje VARCHAR2(1) := 'F';
    valid_combo number := 0;
    obje_id objects.obje_object_id%TYPE;
    obje_name objects.obje_name%TYPE;
    borg_id organizations.orga_organization_id%TYPE;
    appr_id appropriations.appr_appropriation_id%TYPE;
    appr_name appropriations.appr_name%TYPE;
    report_date VARCHAR2(35) := to_char(sysdate, 'Month DD, YYYY');
    bud_auth_amount internal_budget_balances.ibba_budget_authorized_amount%TYPE;
    password_upper VARCHAR2(10);
    v_budadmn_password VARCHAR2(10);
    fmcode time.time_time_code%TYPE;
    fycode time.time_time_code%TYPE;
    fonth     VARCHAR2(100) :=
    '<font face="Verdana, Arial, Helvetica, sans-serif" size=2>';
    fontx VARCHAR2(100) :=
    '<font face="Verdana, Arial, Helvetica, sans-serif" size=3>';
    NULL_EXCEPTION EXCEPTION;
    INVALID_DOC EXCEPTION;
    PASSWORD_FAIL EXCEPTION;
    BEGIN
    SELECT distinct budadmn_password
    INTO v_budadmn_password
    FROM budadmn_password;
    v_budadmn_password := upper(v_budadmn_password);
    v_budadmn_password := rtrim(v_budadmn_password);
    password_upper := upper(password);
    password_upper := rtrim(password_upper);
    IF password_upper = v_budadmn_password
    THEN
    NULL;
    ELSE
    RAISE PASSWORD_FAIL;
    END IF;
    dh_aelg_rec.app_marker := 'GFYD';
    nfdw_budadmn.get_fiscal_data('NONE', fyear, fmcode, fycode, dh_aelg_rec);
    IF dh_aelg_rec.app_error_mesg = 'FAIL'
    THEN
    RAISE NULL_EXCEPTION;
    END IF;
    -- get appr id
    dh_aelg_rec.app_marker := 'APPR';
    nbdm_web.g_appr_id(substr(appr_unit,1,4), substr(appr_unit,5,2), fyear,
    appr_id, dh_aelg_rec);
    IF dh_aelg_rec.app_error_mesg = 'FAIL'
    THEN
    RAISE NULL_EXCEPTION;
    END IF;
    -- get budget org id
    dh_aelg_rec.app_marker := 'ORGA';
    nbdm_web.g_orga_id(budorg, fyear, borg_id, dh_aelg_rec);
    IF dh_aelg_rec.app_error_mesg = 'FAIL'
    THEN
    RAISE NULL_EXCEPTION;
    END IF;
    -- determine id search is by obje or ocat.
    IF length(obje_ocat) > 2
    THEN
    its_an_obje := 'T';
    dh_aelg_rec.app_marker := 'OBJE';
    nbdm_web.g_obje_id(obje_ocat, fyear, obje_id, obje_name,
    substr(appr_unit,1,4), dh_aelg_rec);
    IF dh_aelg_rec.app_error_mesg = 'FAIL'
    THEN
    RAISE NULL_EXCEPTION;
    END IF;
    END IF;
    IF its_an_obje = 'T'
    THEN
    dh_aelg_rec.app_marker := 'CHK1';
    SELECT COUNT(1)
    INTO valid_combo
    FROM internal_budget_balances
    WHERE ibba_fiscal_year_code = fycode
    AND ibba_organization_id = borg_id
    AND ibba_appropriation_id = appr_id
    AND ibba_object_id = obje_id;
    ELSE
    dh_aelg_rec.app_marker := 'CHK2';
    SELECT COUNT(1)
    INTO valid_combo
    FROM internal_budget_balances
    WHERE ibba_fiscal_year_code = fycode
    AND ibba_organization_id = borg_id
    AND ibba_appropriation_id = appr_id
    AND ibba_object_category = obje_ocat;
    END IF;
    IF valid_combo < 1
    THEN
    RAISE INVALID_DOC;
    END IF;
    IF its_an_obje = 'T'
    THEN
    -- Get max(ibba_fiscal_month_code)
    dh_aelg_rec.app_marker := 'FMC1';
    select max(ibba_fiscal_month_code)
    into fmcode
    from internal_budget_balances
    where ibba_fiscal_year_code = fycode
    and ibba_organization_id = borg_id
    and ibba_appropriation_id = appr_id
    and ibba_object_id = obje_id;
    nfdw_budadmn.nfdw_budadmn_rep_head(
    'Budget Maintenance',
    'BMAINT02',
    fyear,
    'N',
    'B',
    'N',
    'N');
    htp.tableOpen('border cellspacing=1 cellpadding=1');
    htp.p('<tr bgcolor=lightblue>');
    htp.tableHeader(fonth||(htf.bold('Orgn')), cattributes=>'WIDTH="2%"',
    calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Appr Unit')),cnowrap=>'nowrap',
    cattributes=>'WIDTH="4%"',calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Appr Name')),cnowrap=>'nowrap',
    cattributes=>'WIDTH="4%"',calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Obje/Cat')),cattributes=>'WIDTH="2%"',
    calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Auth Budget Amount')),
    cattributes=>'WIDTH="2%"', calign=>'center');
    htp.tableRowClose;
    OPEN c1(fycode, borg_id, appr_id, obje_id, fmcode);
    LOOP
    FETCH c1 INTO c1_rec;
    EXIT WHEN c1%NOTFOUND;
    BEGIN
    -- Create HTP
    htp.tableRowOpen;
    htp.tableData(fonth||nvl(c1_rec.orga_organization,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(c1_rec.appr_budget_account_code||
    c1_rec.appr_budget_account_category,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(c1_rec.appr_name,'-'),
    cnowrap=>'nowrap', calign=>'center');
    appr_name := c1_rec.appr_name;
    htp.tableData(fonth||nvl(obje_ocat,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||to_char(c1_rec.ibba_budget_authorized_amount,
    '9,999,999,999.99'), cnowrap=>'nowrap', calign=>'right');
    bud_auth_amount := c1_rec.ibba_budget_authorized_amount;
    htp.tableRowClose;
    htp.tableClose;
    END;
    END LOOP;
    CLOSE c1;
    ELSE
    -- Get max(ibba_fiscal_month_code)
    dh_aelg_rec.app_marker := 'FMC2';
    select max(ibba_fiscal_month_code)
    into fmcode
    from internal_budget_balances
    where ibba_fiscal_year_code = fycode
    and ibba_organization_id = borg_id
    and ibba_appropriation_id = appr_id
    and ibba_object_category = obje_ocat;
    nfdw_budadmn.nfdw_budadmn_rep_head(
    'Budget Maintenance',
    'BMAINT02',
    fyear,
    'N',
    'B',
    'N',
    'N');
    htp.tableOpen('border cellspacing=1 cellpadding=1');
    htp.p('<tr bgcolor=lightblue>');
    htp.tableHeader(fonth||(htf.bold('Orgn')), cattributes=>'WIDTH="2%"',
    calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Appr Unit')),cnowrap=>'nowrap',
    cattributes=>'WIDTH="4%"',calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Appr Name')),cnowrap=>'nowrap',
    cattributes=>'WIDTH="4%"',calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Obje/Cat')),cattributes=>'WIDTH="2%"',
    calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Auth Budget Amount')),
    cattributes=>'WIDTH="2%"', calign=>'center');
    htp.tableRowClose;
    OPEN c2(fycode, borg_id, appr_id, obje_ocat, fmcode);
    LOOP
    FETCH c2 INTO c2_rec;
    EXIT WHEN c2%NOTFOUND;
    BEGIN
    -- Create HTP
    htp.tableRowOpen;
    htp.tableData(fonth||nvl(c2_rec.orga_organization,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(c2_rec.appr_budget_account_code||
    c2_rec.appr_budget_account_category,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(c2_rec.appr_name,'-'),
    cnowrap=>'nowrap', calign=>'center');
    appr_name := c2_rec.appr_name;
    htp.tableData(fonth||nvl(c2_rec.ibba_object_category,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||to_char(c2_rec.ibba_budget_authorized_amount,
    '9,999,999,999.99'), cnowrap=>'nowrap', calign=>'right');
    bud_auth_amount := c2_rec.ibba_budget_authorized_amount;
    htp.tableRowClose;
    htp.tableClose;
    END;
    END LOOP;
    CLOSE c2;
    END IF;
    -- Links
    htp.br;
    htp.br;
    htp.br;
    htp.line;
    htp.tableOpen('CELLSPACING=1 CELLPADDING=1 width="50%"
    bordercolor="#669966"', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    'nfdw_budadmn.del_ibba_warn:2'||'fyear='||fyear||'&'||
    'budorg='||budorg||'&'||'appr_unit='||appr_unit||'&'||
    'obje_ocat='||obje_ocat||'&'||
    'bud_auth_amount='||bud_auth_amount||'&'||
    'appr_name='||appr_name||'&'||
    'fy_id='||fycode||'&'||
    'borg_id='||borg_id||'&'||
    'appr_id='||appr_id||'&'||
    'obje_id='||obje_id||
    '"onMouseOver=" window.status=''Click to Remove IBBA Budget Line.'';
    return true','Remove Budget'),calign=>'CENTER');
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    'nfdw_budadmn.mod_ibba_inp'||
    '"onMouseOver=" window.status=''Click to Return to Query Form.'';
    return true','Return To Query Form'),calign=>'CENTER');
    htp.tableRowClose;
    htp.tableClose;
    EXCEPTION
    WHEN NULL_EXCEPTION THEN
    dh_aelg_rec.app_error_mesg := 'FAIL';
    dh_aelg_rec.comments :=
    'Parameters are: fyear='||fyear||
    ', budorg='||budorg||
    ', appr_unit='||appr_unit||
    ', obje_ocat='||obje_ocat||
    ', password='||password;
    dh_aelg_rec.app_hierarchy := ' nfdw_budadmn.view_ibba_for_maint:';
    util_web.util_return_page
    ('An application error has occurred.',
    'Please contact the I.S. Helpdesk.',
    p_app);
    WHEN INVALID_DOC THEN
    util_web.util_return_page
    ('Requested Data Is Not Available.',
    'Check Request and Try Again.',
    p_app);
    WHEN PASSWORD_FAIL THEN
    util_web.util_return_page
    ('Invalid Password.',
    'Please Reenter.',
    p_app);
    WHEN OTHERS THEN
    dh_aelg_rec.app_error_mesg := 'FAIL';
    dh_aelg_rec.ora_error_number := SQLCODE;
    dh_aelg_rec.ora_error_mesg := substr(SQLERRM, 1, 100);
    dh_aelg_rec.comments :=
    'Parameters are: fyear='||fyear||
    ', budorg='||budorg||
    ', appr_unit='||appr_unit||
    ', obje_ocat='||obje_ocat||
    ', password='||password;
    dh_aelg_rec.app_hierarchy := ' nfdw_budadmn.view_ibba_for_maint:';
    util_web.util_log_app_error(dh_aelg_rec);
    util_web.util_return_page
    ('An application error has occurred.',
    'Please contact the I.S. Helpdesk.',
    p_app);
    END view_ibba_for_maint;
    procedure del_ibba_warn(
    fyear IN VARCHAR2,
    budorg IN VARCHAR2,
    appr_unit IN VARCHAR2,
    obje_ocat IN VARCHAR2,
    bud_auth_amount IN NUMBER,
    appr_name IN VARCHAR2,
    fy_id IN NUMBER,
    borg_id IN NUMBER,
    appr_id IN NUMBER,
    obje_id IN NUMBER)
    IS
    p_app          VARCHAR2(40) :='nfdw_budadmn.mod_ibba_inp';
    exp_ck     number := 0;
    dh_aelg_rec     application_error_log%ROWTYPE;
    fontx          VARCHAR2(100) :=
    '<font face="Verdana, Arial, Helvetica, sans-serif" size=3>';
    fonth          VARCHAR2(100) :=
    '<font face="Verdana, Arial, Helvetica, sans-serif" size=2>';
    BEGIN
    -- Check if budget line has expenditures in the NOEM.
    IF length(obje_ocat) > 2
    THEN
    dh_aelg_rec.app_marker := 'SEL1';
    SELECT count(1)
    INTO exp_ck
    FROM nbdm_object_expense_fmon
    WHERE fiscal_year = fyear
    AND fiscal_month = '12'
    AND budget_org = budorg
    AND budget_account = substr(appr_unit,1,4)
    AND budget_category = substr(appr_unit,5,2)
    AND object = obje_ocat
    AND fytd_expended_amount > 0;
    ELSE
    dh_aelg_rec.app_marker := 'SEL2';
    SELECT count(1)
    INTO exp_ck
    FROM nbdm_object_expense_fmon
    WHERE fiscal_year = fyear
    AND fiscal_month = '12'
    AND budget_org = budorg
    AND budget_account = substr(appr_unit,1,4)
    AND budget_category = substr(appr_unit,5,2)
    AND object_category = obje_ocat
    AND fytd_expended_amount > 0;
    END IF;
    htp.p('<BR>');
    htp.p('<BR>');
    htp.tableOpen('BORDER=0 BGCOLOR=WHITE', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.bold('WARNING!! WARNING!! WARNING'));
    htp.tableRowClose;
    htp.tableClose;
    htp.p('<BR>');
    IF exp_ck > 0
    THEN
    htp.tableOpen('BORDER=0 BGCOLOR=WHITE', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.bold('THE CHOSEN BUDGET HAS VALID EXPENDITURES '));
    htp.tableData(fontx||htf.bold('AND CANNOT BE REMOVED'));
    htp.tableRowClose;
    htp.tableClose;
    ELSE
    htp.tableOpen('BORDER=0 BGCOLOR=WHITE', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.bold('YOU ARE ABOUT TO PERMANANTLY REMOVE '));
    htp.tableData(fontx||htf.bold('THE FOLLOWING'));
    htp.tableRowClose;
    htp.tableClose;
    htp.tableOpen('BORDER=0 BGCOLOR=WHITE', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.bold('AUTHORIZED BUDGET FROM THE NDOT'));
    htp.tableData(fontx||htf.bold('FINANCIAL DATA WAREHOUSE'));
    htp.tableRowClose;
    htp.tableClose;
    htp.p('<BR>');
    END IF;
    htp.tableOpen('border cellspacing=1 cellpadding=1');
    htp.p('<tr bgcolor=lightblue>');
    htp.tableHeader(fonth||(htf.bold('Orgn')), cattributes=>'WIDTH="2%"',
    calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Appr Unit')),cnowrap=>'nowrap',
    cattributes=>'WIDTH="4%"',calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Appr Name')),cnowrap=>'nowrap',
    cattributes=>'WIDTH="4%"',calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Obje/Cat')),cattributes=>'WIDTH="2%"',
    calign=>'center');
    htp.tableHeader(fonth||(htf.bold('Auth Budget Amount')),
    cattributes=>'WIDTH="2%"', calign=>'center');
    htp.tableRowClose;
    htp.tableRowOpen;
    htp.tableData(fonth||nvl(budorg,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(appr_unit,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(appr_name,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||nvl(obje_ocat,'-'),
    cnowrap=>'nowrap', calign=>'center');
    htp.tableData(fonth||to_char(bud_auth_amount,
    '9,999,999,999.99'), cnowrap=>'nowrap', calign=>'right');
    htp.tableRowClose;
    htp.tableClose;
    htp.br;
    htp.br;
    htp.br;
    htp.line;
    IF exp_ck > 0
    THEN
    htp.tableOpen('CELLSPACING=1 CELLPADDING=1 width="50%"
    bordercolor="#669966"', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    'nfdw_budadmn.mod_ibba_inp'||
    '"onMouseOver=" window.status=''Click to Return to Query Form.'';
    return true','Return To Query Form'),calign=>'CENTER');
    htp.tableRowClose;
    ELSE
    htp.tableOpen('CELLSPACING=1 CELLPADDING=1 width="50%"
    bordercolor="#669966"', calign=>'center');
    htp.tableRowOpen;
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    'nfdw_budadmn.del_ibba_line:1'||
    'fy_id='||fy_id||'&'||
    'borg_id='||borg_id||'&'||
    'appr_id='||appr_id||'&'||
    'obje_id='||obje_id||'&'||
    'obje_ocat='||obje_ocat||'&'||
    'fyear='||fyear||'&'||
    'budorg='||budorg||'&'||
    'appr_unit='||appr_unit||
    '"onMouseOver=" window.status=''Click to Remove IBBA Budget Line.'';
    return true','Remove Budget'),calign=>'CENTER');
    htp.tableData(fontx||htf.anchor(owa_util.get_owa_service_path||
    'nfdw_budadmn.mod_ibba_inp'||
    '"onMouseOver=" window.status=''Click to Return to Query Form.'';
    return true','Return To Query Form'),calign=>'CENTER');
    htp.tableRowClose;
    END IF;
    htp.tableClose;
    EXCEPTION
    WHEN OTHERS THEN
    dh_aelg_rec.app_error_mesg := 'FAIL';
    dh_aelg_rec.ora_error_number := SQLCODE;
    dh_aelg_rec.ora_error_mesg := substr(SQLERRM, 1, 100);
    dh_aelg_rec.app_hierarchy := ' nfdw_budadmn.del_ibba_warn:';
    dh_aelg_rec.comments :=
    'Parameters are: fyear='||fyear||
    ', budorg='||budorg||
    ', appr_unit='||appr_unit||
    ', obje_ocat='||obje_ocat||
    ', bud_auth_amount='||bud_auth_amount||
    ', appr_name='||appr_name||
    ', fy_id='||fy_id||
    ', borg_id='||borg_id||
    ', appr_id='||appr_id||
    ', obje_id='||obje_id;
    util_web.util_log_app_error(dh_aelg_rec);
    util_web.util_return_page
    ('An application error has occurred.',
    'Please contact the I.S. Helpdesk.',
    p_app);
    END del_ibba_warn;

Maybe you are looking for

  • Process order creation problem

    I am creating a process order . while creating the process order system is throwing error as Auto batch numbering not set up for material type XXXX in plant xxxx . System is not allowing to create process order. How to resolve the issue.

  • Is it a bug of the cisco OS?

    hi, i have a cisco 1230 access point and i m using snmp with it, so there are some fields in cisco mib "ciscoDot11AssociationMIB", that doesn t return any value : the wired interface of the AP gives me all informations (mac adress, ip adress,...) but

  • Creating PDF in Word 2007 creates horizontal line

    Hello, This is my first post in this forum. In general, I have not had problems creating PDFs from Word 2003, or from Word 2007 - from either .doc or .docx documents. Yesterday, with one document, when I created a PDF, a centered horizontal line kept

  • Inbound Allow ACL when http headers inspection is true.

    Hello, I have a request to make the following work on an asa 5515 deployment and I'm receiving a lot of conflicting information about how to implement the solution. I have an external provider that requires access to an internal non-ssl webpage. They

  • Stopping a video at a point

    Hi, I´m trying to stop a Video at a specific Point to start an new Frame at that Point. The Video should be stopped until I go back to the frame. Is there any posiibility to realize. I would be glad about any help or Information. Is there any Chance