Calling a PL/SQL Procedure from button and then return to same page

I have a button called "Process" that I want to call the database stored procedure "BUILD_WORKDAYS" with parameters P14_PROCESS_YEAR as an input parameter. I have the button on the page but is this a PL/SQL Page Process or a PL/SQL Branch? I have tried a number of combination but don't seem to be able to get the database procedure to execute. What should the syntax be?
Thanks

"I have a button called "Process" that I want to call the database stored procedure "BUILD_WORKDAYS" with parameters P14_PROCESS_YEAR as an input parameter"
Assuming you are starting with an empty Apex page:
1) Create a region of some type or other, say HTML.
2) Create a button of type "Create a button in region position" in this region. Sounds like you've already done this and called it PROCESS.
3) Create a process of type PL/SQL, On Submit After Computations and Validations.
4) Call it "Execute BUILD_WORKDAYS" (or whatever you like)
5) The PL/SQL for the process is:
BUILD_WORKDAYS(:P14_PROCESS_YEAR);
6) Specify a success and failure message.
7) In the final step of the Create Page Process wizard, select your button from the "When button pressed" select list.
8) Then create an unconditional branch branching to the same page.
That should be it.
Andy

Similar Messages

  • How to call a PL/SQL procedure from a Java class?

    Hi,
    I am new to the E-BusinessSuite and I want to develop a Portal with Java Portlets which display and write data from some E-Business databases (e.g. Customer Relationship Management or Human Resource). These data have been defined in the TCA (Trading Community Architecture) data model. I can access this data with PL/SQL API's. The next problem is how to get the data in the Java class. So, how do you call a PL/SQL procedure from a Java program?
    Can anyone let me know how to solve that problem?
    Thanks in advance,
    Chang Si Chou

    Have a look at this example:
    final ApplicationModule am = panelBinding.getApplicationModule();
    try
         final CallableStatement stmt = ((DBTransaction)am.getTransaction()).
                                                                                         createCallableStatement("{? = call some_pck.some_function(?, ?)}", 10);
         stmt.registerOutParameter(1, OracleTypes.VARCHAR);
         stmt.setInt(2, ((oracle.jbo.domain.Number)key.getAttribute(0)).intValue());
         stmt.setString(3, "Test");
         stmt.execute();
         stmt.close();
         return stmt.getString(1);
    catch (Exception ex)
         panelBinding.reportException(ex);
         return null;
    }Hope This Helps

  • How to call a PL/SQL procedure from Portal

    Env.Info: Windows NT Server 4 (Service Pack 3) / Oracle 8i R3 EE / Oracle Portal 3.0 Production.
    I created a new schema "BISAPPS" and created a user with the same name. Ran provsyns.sql script to grant Portal API access. Created a new package under this new schema and compiled it against the database. After that I registered the schema as a portal provider. There were no errors.
    Now I logged into Portal using the account PORTAL30. Refreshed the portlet repository and the new portlets appeared. I added the new portlet to the page. It is displayed successfully.
    New portlet allows the user to enter a bug-number and lets the user to either view or edit. If the user clicks on the button "Edit", it opens a new window and displays the contents from BugDB application. But if the user clicks on "Show", it should display the output generated by a PL/SQL procedure (Owned by the above New Schema - BISAPPS) in a separate window. But instead it is displaying the following error in the separate window:
    bisapps_pkg.buginfo: PROCEDURE DOESN'T EXIST.
    DAD name: PORTAL30
    PROCEDURE : bisapps_pkg.buginfo
    URL : http://host_name:80/pls/portal30/bisapps_pkg.buginfo
    And list of environment variables ....
    Can anyone help me? How can I call a PL/SQL procedure when the button is clicked? Thanks in advance.

    You must grant EXECUTE privilege on your procedure to the PORTAL30_PUBLIC user. If the error still persists, create a PUBLIC synonym for your procedure.

  • Error when try to call a pl/sql procedure from the .xsql file

    I tried to call a pl/sql procedure like this:
    <?xml version="1.0"?>
    <page connection="omtest5" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa>
    sampleowaxml.testone
    </xsql:include-owa>
    </page>
    but I got the following error message:
    <?xml version="1.0" ?>
    - <page>
    - <xsql-error action="xsql:include-owa">
    <statement>declare buf htp.htbuf_arr; param_names owa.vc_arr; param_values owa.vc_arr; rows integer := 32767; outclob CLOB;begin param_names(1) := 'HTTP_COOKIE'; param_values(1) := ''; param_names(2) := 'SERVER_NAME'; param_values(2) := 'mxfang-nt.us.oracle.com'; param_names(3) := 'SERVER_PORT'; param_values(3) := '80'; param_names(4) := 'SCRIPT_NAME'; param_values(4) := '/servlets/oracle.xml.xsql.XSQLServlet'; param_names(5) := 'PATH_INFO'; param_values(5) := '/xsql/test/myproject.xsql'; param_names(6) := 'HTTP_USER_AGENT'; param_values(6) := 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)'; owa.init_cgi_env(6,param_names,param_values); sampleowaxml.testone owa.get_page(buf,rows); dbms_lob.createtemporary(outclob,true,dbms_lob.session); for i in 1..rows loop dbms_lob.writeappend(outclob,length(buf(i)),buf(i)); end loop; ? := outclob; ? := DBMS_LOB.INSTR(outclob,CHR(10)&#0124; &#0124;CHR(10));end;</statement>
    <message>ORA-06550: line 3, column 3: PLS-00103: Encountered the symbol "OWA" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "OWA" to continue.</message>
    </xsql-error>
    - <xsql-error action="xsql:include-owa">
    <message />
    </xsql-error>
    </page>
    This error message is very similiar to the message that Shanthir posted on Jan, 21. I did run the dbmslob.sql, but it doesn't help. Anybody has ideas how to solve it?
    I used the PL/SQL web toolkit provided by OAS4.0.8.1. I believe oracle web agent is replaced by this toolkit.
    Thanks,
    Min
    null

    Hi,
    Glad that somebody else too got this problem. Well, as I had mentioned in my previous posting too, I think there are some procedures in the package, dbms_lob, like the writeappend, createtemporary etc.. which is not found in my dbms_lob.sql file, I am using 8.0.5, but I found these procedures in the 8i, I think it is becos of that.
    By the way if anybody got this solution and got any workaround, please help me too.
    I am still waiting for the solution to that.
    Shanthi

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

  • Is there a way to force the tab order to skip a page and then return to that page on a form?

    I have a multi-page form with a required page layout.  The problem with the current form layout, is that I'm finding my users are getting to page "20" and it seems like the natural end of the form...and stop entering information and submit.  The problem is, there's an additional form field on the next page that MIGHT need important information.
    The information in that final field is only present in about 10% of submissions, but is crucial to the file if present.  As I said, the page layout is required.
    Is there a way to change the tab order to go from the last form field on page "19" to the form field on page "21" and then back to the form fields on page "20"?

    Thanks try67, but it isn't a required field.  As I mentioned, only about 20% of submissions will require filling it in. 
    There isn't a submit button.  Not even sure what I would do with/or how I would implement a submit button.  After processing the form, the filled out form is 'Saved As' to keep the original forms integrity intact.  The 'Saved As' file  is renamed appropriately, and then it is printed to a PDF file and attached to the appropriate customer file.

  • Using system variables to open new SCO and then return to same slide in previous SCO

    Hi,
    I am working on a eLearning project which will have about 30-40 individual lessons (SCOs), with a common Glossary of terms used in the lessons.  The user needs to be able to click on the Glossary button in any lesson, go to the Glossary and then ideally return to the same slide in the SCO where they clicked on the Glossary button.
    I am still learning Advanced Actions but I have seen variables such as curentScene, and currentFrame.  Could these variables be used to create an Advanced Action which would take the user back to the same slide or is there a system variable which could be used to peform this function?
    Really need help on this one.  If what I am trying to do is not possible then knowing that would be very useful too as I will not spend anymore time trying to find a solution but will look at other alternatives.
    Thanks,
    Richard

    When you reopen a file, all variables are reset... so with Advanced actions this will not be possible AFAIK. Michael Lund, cpguru, has a Save and Load Data widget that allows to pass values of variables between files. Maybe JavaScript could help as well?
    I do not know the system variable you are pointing to. There is cpInfoCurrentSlide and cpInfoCurrentFrame but scenes? Perhaps you are using StoryLine and confusing the terminology. In this blog post you can find a link to the complete list with available system variables in Captivate 6:
    http://lilybiri.posterous.com/system-variables-in-captivate-6
    Lilybiri

  • Unable to call a pl/sql procedure from java

    Software : Oracle 9i & Red hat linux 9
    Code:
    import java.io.*;
    import java.sql.*;
    public class test
    public static void main(String args[])
    try
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.221:1521:elearn","gowri","gowri");
    CallableStatement call=con.prepareCall("{call ins(?,?,?,?)}");
    call.setInt(1,5);
    call.setString(2,"hari");
    call.setString(3,"m");
    call.setString(4,"1976-12-26");
    if ( call.execute() )
    System.out.println("Success");
    else
    System.out.println("fails");
    call.close();
    con.close();
    catch(Exception ex)
    System.out.println("Error :"+ex);
    ~
    ~
    ~
    Stored Procedure:
    create or replace procedure ins(no in number,name in varchar,sex in varchar,dob in varchar)is
    con_day date;
    begin
    con_day=to_date(dob,'yyyy-mm-dd');
    insert into person values(no,name,sex,con_day);
    end;
    Run Time Error:
    Exception in thread "main" java.lang.IncompatibleClassChangeError: oracle.jdbc.driver.OraclePreparedStatement
    at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x4025bc8e: java.lang.Error.Error(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x4025d6b6: java.lang.LinkageError.LinkageError(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x4025c7aa: java.lang.IncompatibleClassChangeError.IncompatibleClassChangeError(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x40229eed: JvPrepareClass(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x40248028: java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x4025acb3: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x402299cb: JvPrepareClass(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x40248028: java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x4025acb3: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x4024646c: java.lang.Class.initializeClass() (/usr/lib/./libgcj.so.3)
    at 0x40230912: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x4022e504: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x4038305c: ?? (??:0)
    at 0x403831e7: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x403831a7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x402306e8: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x4022e58a: JvInterpMethod.run_synch_object(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x4038305c: ?? (??:0)
    at 0x403831e7: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x403831a7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x402306e8: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x4022e504: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x4038305c: ?? (??:0)
    at 0x40242dd8: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/./libgcj.so.3)
    at 0x402ad02d: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)
    at 0x4024fc4c: JvThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
    at 0x4021c8ac: JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/./libgcj.so.3)
    at 0x08048910: ?? (??:0)
    at 0x42015574: __libc_start_main (/lib/tls/libc.so.6)
    at 0x080486c1: ?? (??:0)

    Hi Gowrishankar,
    This is just a suggestion (based on a guess). Try changing this line of your code:
    call.setInt(1,5);with this line:
    call.setBigDecimal(1,5);Good Luck,
    Avi.

  • How to call a PL/SQL Procedure from a Report Column Hyperlink

    Hallo!
    Normally a link on a column value in a report leads you to a page in your application or to another URL.
    And you can send the value of this cell to the calling page.
    I want, that oracle executes a procedure with the values as in-Parameters if I click on this hyperlink.
    Must I call a dummy page and define this procedure in the header of this page or exit there other ways?
    Can you give ma an example?
    Thanks a lot!
    Gerhard

    Paul - When a column link is used to invoke a On Demand Process in that way, wouldn't that result in a blank page (unless of course the ODP emits a well-formed HTML document)? You could set the link target to a no-op like *#* and use a onclick handler in the Link Attributes to call a Javascript that uses the htmldb_get object to call the ODP. In fact, I don't think I have ever seen a ODP used in any other context.

  • 403 Forbidden error calling PL/SQL Procedure from URL

    I am getting a 403 Forbidden browser error when calling a PL/SQL procedure from the URL, as in this:
    http://<server.port>/apex/SCHEMA.procedure_name/f?p_param1=394&p_param2=2, etc
    We are upgrading from HTMLDB 2.0 to APEX 4.0.2. I do not believe the upgrade has anything to do with it, c/o the upgraded app works fine in another APE 4.0.2 environment.
    The upgrade is to new machines, new DB and new app server, Oracle Web Tier, Oracle HTTP server deployment.
    The dads.conf entries are fine, all standard:
    Alias /i/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/images/"
    Alias /c/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/custom_htmldb/"
    <Location /pls/apexd>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
    PlsqlDatabaseConnectString dbserver.us.com:1521:SERVER.US.COM ServiceNameFormat
    PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode Basic
    SetHandler pls_handler
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDatabaseUsername APEX_PUBLIC_USER
    PlsqlDefaultPage apex
    PlsqlDatabasePassword apexpwd
    PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
    Allow from all
    </Location>
    The GRANT EXECUTE ON procedure TO PUBLIC is there.
    A call to the same procedure via a process in an APEX page works fine - the procedure is OK.
    The call from javascript, which sets up the call from the URL, is the one that fails with the 403 Forbidden error.
    The same app works fine in another APEX 4.0.2 environment, so I know it is not the JS; It has to be some configuration setting in this environment.
    I do NOT have access to the app server.
    I have asked that they compare the httpd.conf, and all underlying conf files, to check for differences.
    In order for me to be more specific, and hopefully speed up the troubleshooting process, can anyone suggest what other settings to look at?
    Thank you - Karen

    Hello,
    Good catch, but the difference in URL is in fact the difference in my env to theirs. My typo in not correcting my example to match the dads.conf entry of /pls/apexd. My env uses /apex/. Just saves on my typing.
    As an update, I asked the DBA to double-check, and yes, the www_flow_epg_include_mod_local function IS there.
    www_flow_epg_include_mod_local is an APEX function.
    So now we are trying adding procedures to it. I'll let you know if it works.
    My previous question remains - why would I need to do this in one env, and not another,
    given that the DB GRANTs are there.
    Is there a particular app server setting that wil block execution of PL/SL procedures from the URL?
    My guess is, there is some difference in configuration settings for the app server, somewhere in the httpd.conf chain.
    Since I do not have access to those files, I cannot do a diff myself, as I would have if I the issue was on my machine.
    I am in a situation where I can suggest what to do, but that's it. I agree, it's hard to troubleshoot in this situation.
    I am being asked "what setting do I need to change?" without the benefit of access to what is there,so I am doing the best I can, without diverting from my work for a deep-dive refresher session on httpd.conf settings.
    So, if anyone is aware of some setting that would block execution of a PL/SQL proc from the URL, please let me know,
    and of course, if adding a proc to www_flow_epg_include_mod_local works, I'll be happy. Just still curious.
    Thank you - K

  • Problem calling PL/SQL procedure from Workflow function activity.

    Hi,
    I am trying to call a PL/SQL procedure from within my workflow activity.
    While I am able to execute the procedure through SQLDeveloper, the workflow function does not seem to call it.
    It seems that custom PL/SQL procedures have to conform to certain standards to be called within workflow applications. I have written my procedure to conform to those standards (referred to the example workflows).
    Could someone please help me with it?
    Thanks and regards.

    Hi,
    When I've received enough alpha reviews of the first few chapters of my book, I'll make chapter five available, which deals with writing functions for Workflows.
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com

  • Calling pl/sql procedure from jsp

    Hi:
    Could anyone tell me how to call a pl/sql procedure from a jsp page by passing args or without . Is there any specific method to use.
    Thanks.

    Like from any other java code
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(); END;");
    cs.execute();
    %>
    With params:
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.execute();
    %>
    to return some value as out param
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?, 3); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.registerOutParameter(3, Types.VARCHAR);
    cs.execute();
    out.println("Returned value: " + cs.getString(3));
    %>
    Of course after all close statement and connection to free resources.

  • Calling a PL/SQL Package from a controller

    Hi ,
    I have to add some busines funtionality to the standard existing oco page .
    i have extened the standard controller and add the validation logic there , now if the validation is true i have to call a pl/sql package to do some functions . now i am facing few issues here
    a) can i call a pl/sql package from a controller ?
    b) should i extend the standard AM and call the pl/sql package from the extended am . is extending am allowed ?
    please let me know the best sol to achieve this

    a) can i call a pl/sql package from a controller ?<b>Yes</b> you can call a pl/sql procedure from controller through <b>OracleCallableStatement</b> object.
    <br>
    b) should i extend the standard AM and call the pl/sql package from the extended am . is extending am allowed ?Extending AM is <b>allowed</b>, but as can achieve your goal through the CO extension, why bother to touch AM :)
    --saroj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Call a PL/SQL procedure or function from applet

    Could anyone please let me know how I could call a PL/SQL procedure
    or function from a JDBC method from applet with Internet Explorer?

    It depends from where you are calling your PLSQL routine. If it is SQL*Plus then you can use & (ampersand) with the variable to be input at run time.
    If you are executing the PLSQL routine from another application (some front end application) then it's not possible. Because when a procedure is executing at server side, the front end application does not have control, and the control is only transfered back to front end application when the PLSQL routine either completes successfully or throws an exception.
    In either case, you can not go back to the PLSQL routine.
    In this case, what you can do is, write code in your front end application to get that variable value from user and then pass that value to PLSQL routine.

  • Calling PL/SQL procedures from a Windows CMD script

    Hello,
    I am writing a Windows CMD script. From this script I want to call procedures from a PL/SQL package which selects, inserts or deletes rows from the database.
    How do I go about logging into the database from the cmd script and calling PL/SQL procedures from there?
    Does anyone have any examples of such scripts? Thanks in advance.

    No, it is not a job that needs to be scheduled.
    The script will be used when needed to select info from a certain table and also to insert or delete certain info into/from this table (so, it is just simple sql statements which I have put into a package), but I'm sure how to log into the database and execute the procedures from this package in a cmd script.

Maybe you are looking for