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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How to call at PL/SQL package?

    Hi,
    How to call a PL/SQL package from withing a VORowImpl?
    Also what packages need to be imported for this?
    Thanks,
    AD

    Hi,
    Thanks for the replies friends.
    I understand this is not a good practice to call a pl/sql package. I tried as per the OAF standards.
    My requirement is to display the GL String in a region of type table. This is in iExpense and the region is (ReviewBusinessCCardTblRN.xml) i.e. the Review page in the Expense report creation steps.
    The data in this region is not coming directly from one VO. There are two VOs involved in it.
    1> BusinessCCardLinesForReviewVO
    2> ReceiptBasedLinesVO (This is the actual source of data and it contains a SQL statement)
    The "BusinessCCardLinesForReviewVORowImpl" calls methods in "ReceiptBasedLinesVORowImpl" to get all the data.
    So, my approach was to
    1> Extend "ReceiptBasedLinesVO" and add an attribute for the GL String in the SQL statement.
    2> Write a method in the "ReceiptBasedLinesVOExRowImpl" to fetch the GL String.
    3> Extend BusinessCCardLinesForReviewVO and add an attribute for the GL String.
    4> In the extended VO's (BusinessCCardLinesForReviewVOExRowImpl) row impl, call "ReceiptBasedLinesVOExRowImpl" GL String method.
    5> Then use "BusinessCCardLinesForReviewVO" GL string attribute to display in the region.
    Is there anything wrong with this approach?
    But, this does not seem to be working.
    Steps 3, 4, 5 are working as I tested with hard coded values in "BusinessCCardLinesForReviewVOExRowImpl".
    But when I call method in "ReceiptBasedLinesVOExRowImpl" to get the GL String, it does not working. No error returned. The page displays all the values as it was displaying in the standard functionality.
    As this is an urgent requirement, I thought of writting a PL/SQL function which would take CCID from "BusinessCCardLinesForReviewVO" and return the GL String.
    And call this PL/SQL funtion in "BusinessCCardLinesForReviewVOExRowImpl".
    Please help me on this.
    Srini: Could you please give the exact syntax for calling the PL/SQL stored function in VORowImpl.
    Thanks,
    AD

  • Calling SQL packages from java

    How do I call ORACLE sql packages from java?
    We are still using Oracle 7.3. Any sample code
    would be appreciated.

    utility.processPLSQL( connRisk,
    " Begin "
    + " hvar_sum.p_load_var_summary_data("
    + " '" + dfCall.format( priceDate ) + "', "
    + " '" + promptMonth + "',"
    + daysBack + ","
    + aliasType + ","
    + "'" + connRisk.owner + "'"
    + "); "
    + " end ; ",
    "Load VaR Summary Data",
    utility.noLogMsg ) ;
    public boolean processPLSQL(
    MyConnection conn,
    String sql,
    String dataType,
    boolean createLogMessage ) {
    double startTime = conn.log.getStartTime() ;
    try {
    CallableStatement cs = conn.theConnection.prepareCall(sql);
    cs.execute() ;
    cs.close() ;
    conn.theConnection.commit();
    if ( createLogMessage ) conn.log.logTiming( dataType, startTime ) ;
    } catch ( SQLException e ) {
    conn.log.logError( "Utility.processPLSQL; SQLException Error: " + e ) ;
    System.out.println(new java.util.Date().toString() + "; User: " + conn.user
    + "; SQL: " + sql );
    return false ;
    return true ;
    }

  • 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

  • Calling functions in a package from jdbc

    I am trying to call a function in a PL/SQL package from a java program using JDBC. Is this a valid option? The statement I am using is the following:
    stProc = myconnect.prepareCall ("{? = call process_monitor_pkg.open_sod_cursor}");
    I am receiving the following error message:
    Errorjava.sql.SQLException: ORA-06576: not a function or procedure
    I have verified that the function/package is defined and that I have the correct output parameter registered.
    Any help would be greatly appreciated.

    try this :
    stProc = myconnect.prepareCall (
    "{ ? = call process_monitor_pkg.open_sod_cursor() }");
    You have to put parenthesis even if there's no parameters...

  • Calling a PL/SQL function from java

    I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
    Please send an example.
    TIA,
    Darko Guberina

    Documentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
    says JPublisher can publish records too.
    But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
    PACKAGE "COMPANY" AS
    type emp_rec is record (empno number, ename varchar2(10));
    type emp_list is varray(5) of emp_rec;
    type factory is record (
    name varchar(10),
    emps emp_list
    function get_factory(p_name varchar) return factory;
    END;
    then I see <unknown type or type not found> at sql or java files generated. Any ideas?

  • 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

  • Call a view's method from Component Controller.

    Hi
    Is it possible to call a view's method from Component Controller.
    Regards
    Nikhil

    Hi Tummuru,
    I have created an event in Component Controller by the name toMenuView. Now I created a method in which this event is getting fired. Foll. is the code of the method.
      public void fireToMenuView( )
       wdComponentAPI.getMessageManager().reportSuccess("fireToMenuView");
       wdThis.wdFireEventToMenuView();
    Now I have created an event handler "handleToMenuView" in the MenuView and subscribed the event handler to the event in Component Controller.
    The control is reaching to the fire event in component controller but not to the Event handler in view controller.
    What am I missing.
    Regards
    Nikhil

  • Calling User written pl/sql Packages from forms 9ias

    I want to call Pl/sql package (my own) from forms 9ias.
    Actaully i am upgrading my application forms 6i to 9ias forms.
    Please suggest me a solution.

    Same way as 6i. What is the problem ?

  • 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.

  • Calling custom pl/sql package on termination of Employee

    Hi,
    I want to call a custom pl/sql package that will create an element entry for employees, with their outstanding holiday entitlement upon termination.
    One way I have tried to do this is by personalizing the end employment form, but I get this error - ORA-00923: FROM keyword not found where expected
    from this code:
    <h5> ='declare
    l_element_entry_id NUMBER;
    l_object_version_number NUMBER;
    l_create_warning BOOLEAN;
    begin
    pay_element_entry_api.create_element_entry(p_validate => FALSE
    ,p_effective_date => (${item.period_of_service.actual_termination_date.value})
    ,p_business_group_id => 106
    ,p_assignment_id => (select assignment_id from per_all_assignments_f where person_id = ${item.period_of_service.person_id}
    and primary_flag = 'Y')
    ,p_element_link_id => 3499
    ,p_entry_type => 'E'
    ,p_input_value_id1 => 7318
    ,p_entry_value1 => (XX_PERSNS_UTILS.GetLeaveAccrual(${item.period_of_service.person_id}))
    --,p_cost_allocation_keyflex_id => ee_asg_api_rec.cost_allocation_keyflex_id
    ,p_effective_start_date => ((${item.period_of_service.actual_termination_date.value})-1)
    ,p_effective_end_date => ${item.period_of_service.actual_termination_date.value}
    ,p_element_entry_id => l_element_entry_id
    ,p_object_version_number => l_object_version_number
    ,p_create_warning => l_create_warning
    end'
    </h5>
    I also thought another way to accomplish this would be using business events but under Workflow Administrator I can see the Business Events and subscriptions but I can only search for existing set-up, I can't create my own.
    Does anyone have any ideas why this personalisation isn't working or has any other ideas of how to go about this?
    Thanks

    This is a tough solution to implement. The drawbacks of Forms Personalization, if you get it working, are that it won't be called from other areas (People Management templates, Self Service Termination etc). The drawbacks of API User Hooks are that they're not used in all places either. Finally, as mentioned, reverse termination means that you need to then backout such holiday payout entries.
    The most reliable way to do this is with an batch process, eg, concurrent program, that runs, say, daily:
    1) Find all employees physically terminated yesterday (regardless of their actual termination date)
    2) Calculate and create the holiday payout entry (if it's not already there)
    3) Find all employees who were updated yesterday and HAVE the holiday payout entry (this is the way to detect those who have been reverse terminated)
    4) Date-track purge the holiday payout entry.
    5) Consider API User Hooks to pick up late changes to absence records or anything that might affect any holiday already paid out so that you can update the holiday payout entry
    6) Configure retro to handle holiday payout for retrospective terminations, deductions for those who were paid holiday payout and later reverse terminated, and subsequent changes to the amount paid out (eg, because of late changes to absence records)

  • 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

  • Call a pl/sql function froma jsp

    I need to call an pl/sql function which basically returns true or false depending on the count. based on the return value I have to alert a message. how can i call the pl/sql fucntion in a jsp?
    thanks for ur help.

    You call the function the same way you would from anywhere, although i don't recommend you call database functions directly from a JSP page as it's bad form.

  • Call a PL/SQL Package

    Hi All,
    I'm using ADF BC, JDev 11G.
    I need to call a stored package to do the validations for the data entered in the page design. I would like to know how to call the package from AppmoduleImpl.java Any example for reference would be helpful.
    Thanks in Advance, assistance will be appreciated.
    Jyothi

    Use a method like the following inside your AppModuleImpl file.
      public Integer myMethod(String pParam1, int pParam2) {
        int returnValue = 0;
        String selectDML = "{? = call pkg_name.pkg_function(?,?)}";
        CallableStatement statement = getDBTransaction().createCallableStatement(selectDML, 1);
        try {
          statement.registerOutParameter(1, Types.INTEGER);
          statement.setInt(1, returnValue);
          statement.setString(2, pParam1);
          statement.setInt(3, pParam2);
          statement.execute();
          returnValue = statement.getInt(1);
          statement.close();
          return returnValue;
        } catch (Exception ex) {
          throw new JboException(ex);
      }The above a example uses a pkg with 1 out and 2 in params, customize it to your needs.
    Then you could use it inside a managed bean like follows:
      private int returnValue;
      public int getReturnValue() {
        ApplicationModule am =
          BindingContext.getCurrent().getDefaultDataControl().getApplicationModule();
        AppModuleImpl appModuleImpl = (AppModuleImpl)am;
        returnValue = appModuleImpl.myMethod("aString", 0);
        return returnValue;
      }Hope that helps.
    Matthew.

  • Calling Web PL/SQL page from Employee Search Page

    Hello,
    I have a requirement where in I have to call a custom Web PL/SQL self service page from the Employee Search page (this is a page where managers search employees giving criteria as First Name, Last Name, Assignment number etc. which is a OA Framework page supplied by Oracle)
    Now situation is after search when I will click on Details button on the search results table the custom Web PL/SQL page should be called.
    But I am not able to figure out how to do it. Could anybody be able to help me on this ?

    You have to set the destination property of the button to call your WebPL/SQL page.

Maybe you are looking for