How to call the pl/sql function in application of the ADF

Hi Experts,

I need to call the pl/sql function in application of ADF, I have logic written in my AM

Method:

public String reportStoredProcedure (locationID customerID, number,
String tailNum) {}

CallableStatement st = null;
String v_sanctioned = null;
If (locationID! = null & & customerID! = null & & tailNum! = null) {}
System.out.println (locationID + "" + customerID + "" + tailNum);
Tail string = "TAIL";
String result = "N";

try {}
String stmt =
"start XXWFS_SANCTIONS_PKG. CHECK_SANCTION(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11); end; « ;
St = getDBTransaction () .createCallableStatement (stmt, 0);
st.setNull (1, Types.VARCHAR);
st.setNull (2, Types.NUMERIC);
st.setObject (3, customerID);
st.setNull (4, Types.NUMERIC);
st.setNull (5, Types.NUMERIC);
st.setObject (6, locationID);
st.setNull (7, Types.NUMERIC);
st.setNull (8, Types.NUMERIC);
st.setObject (9, tail);
st.setObject (10, tailNum);
st.setObject (11, result);
St.Execute ();
System.out.println ("v_sanctioned in AM:" + v_sanctioned);
} catch (Exception e) {}
e.printStackTrace ();
return "N";
} {Finally
If (st! = null)
try {}
St.Close ();
} catch (Exception e1) {}
E1. PrintStackTrace();
return "N";
}
}
} else {}
System.out.println ("v_sanctioned is null");
v_sanctioned = "N";
}
Return v_sanctioned;
}


Error:

java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in the call to 'CHECK_SANCTION '.
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1224)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3858)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:99)
at model.view.CardAMImpl.reportStoredProcedure(CardAMImpl.java:182)
at com.emboss.bean.ReadyToPrint.invokeVSanctioned(ReadyToPrint.java:485)
at com.emboss.bean.ReadyToPrint.PrintingCards(ReadyToPrint.java:434)
at com.emboss.bean.ReadyToPrint.printCards(ReadyToPrint.java:204)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:90)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:91)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:94)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.doIt (WebAppServletContext.java:3684)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Can someone help me how to call...

Call it in function, not as a procedure you do

try {
String stmt =
"begin :1 := XXWFS_SANCTIONS_PKG.CHECK_SANCTION(:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;";
st = getDBTransaction().createCallableStatement(stmt, 0);
st.registerOutParameter(1, Types.VARCHAR);
st.setNull(2, Types.VARCHAR);
st.setNull(3, Types.NUMERIC);
st.setObject(4, customerID);
st.setNull(5, Types.NUMERIC);
st.setNull(6, Types.NUMERIC);
st.setObject(7, locationID);
st.setNull(8, Types.NUMERIC);
st.setNull(9, Types.NUMERIC);
st.setObject(10, tail);
st.setObject(11, tailNum);
st.setObject(12, result);
st.execute();
 = st.getString(1);

Tags: Java

Similar Questions

  • How to call a pl/sql function ofa

    Hello

    When I train call Comptrollership, the error as "bind variable does not exist. Function has 2 input parameters, and it returns a Boolean value. How to solve this error? Can someone help me please... I'm new to OFA.

    TXN OADBTransaction = am.getOADBTransaction ();
    CallableStatement cs = CreateCallableStatement ("Begin: 1: = resp_license_func (?)") End; ", 2) ;
    String outputval = null;
    try {}
    cs.setString(1,appl_name);
    cs.setString(2,user_name);
    cs.registerOutParameter(1,Types.VARCHAR);
    CS. Execute();
    outputval = cs.getString (1);
    TXN.Commit ();
    }
    catch (Exception e) {}
    throw new OAException (e.getMessage ());
    }

    Thank you
    NGO

    Hello

    You need to change the lines below:

    String outputval = null; for int outputval = 0;

    cs.registerOutParameter(1,Types.VARCHAR); to cs.registerOutParameter(1,Types.NUMERIC);

    outputval = cs.getString (1); to outputval = cs.getInt (1);

    Kind regards.

  • How to call the function (function Build-in user) in Pro * C program

    We have developed the application Pro * C program.
    TimesTen version is "TimesTen release 11.2.1.5.0 (64-bit, Linux/x86_64) (tt112150:53308) 2010-03 - 04 T 20: 39:30Z.

    We would like to develop Pro * C program you are using PL/SQL.

    We have a few questions.
    How to call the function (function Build-in user) in Pro * C program?

    #########
    TEST
    #########

    ttisql:
    Command > create or replace FUNCTION F_SAMPLE (i_str IN VARCHAR2)
    > BACK NUMBER
    > o_number NUMBER;
    > START
    > select i_str
    > in o_number
    > double;
    >
    > O_number RETURN;
    >
    > EXCEPTION
    > Others THEN
    > RETURN 0;
    > END;
    > /.
    display errors
    The function is created.
    Order > show errors
    No errors.
    Command >
    Command > set serveroutput on;
    Command > declare
    > number of num1;
    > start
    > num1: = F_SAMPLE ('A');
    > DBMS_OUTPUT. PUT_LINE ("F_SAMPLE" |) ' ' || NUM1);
    > end;
    > /.
    F_SAMPLE 0

    PL/SQL procedure successfully completed.

    Command >


    Pro * C case:

    EXEC SQL BEGIN DECLARE SECTION;
    number of num1;
    EXEC SQL END DECLARE SECTION;

    EXEC SQL EXECUTE
    Start
    : num1: = F_SAMPLE ('A');
    end;
    END-EXEC;

    Make sure to install:
    Error on line 146, column 3, file plsqlPROC.pc:
    Error on line 146, column 3 in file plsqlPROC.pc
    number of num1;
    .. 1
    PCC-S-02201, encountered the symbol "num1" when expecting one of the following conditions:


    Thank you.

    GooGyum

    There are two problems with your variable declaration:

    1. the name of the variable and type are thew misplacement autour.

    2. you may not use a host variable type.

    If you change this to:

    EXEC SQL BEGIN DECLARE SECTION;
    int num1;
    EXEC SQL END DECLARE SECTION;

    Then it will work very well.

    Chris

  • How to call the java function with javascript setting in mobile adf?

    How to call the java function with javascript setting in mobile adf?

    The ADF Mobile utility container API can be used from JavaScript or Java.

    Application container API - 11 g Release 2 (11.1.2.4.0)

  • How to call the javascript function in ADF

    I have the javascript function stored in a .js file external (try to reuse in another application). How can call the javascript function for an event of ADF faces component. I need to I am a newbie to ADF, all ideas are appreciated.

    Kind regards
    Surya

    Published by: sgodavar on Sep 24, 2010 11:44

    Include JavaScript to the jsff/jspx as page:

    Call it like:

    Type = "dblClick" / >
    Amit

  • How to call the stored procedure when I press the button

    Hello

    I want to know how to call the procedure/SQL statement when I press the button using callable statement.

    can someone give me it please link who knows the steps to do this.

    Thanks in advance,
    SAN

    Hello

    read this good example http://www.baigzeeshan.com/2010/05/calling-plsql-procedure-and-function-in.html

    ~ Abhijit

  • How to call the web service?

    Hello

    I want to know how to call the web service from my application HTML5 & javascript.

    Please help me find this detail as what I can access easily. and I want to access web services online (a method of it) I'm not concered with how background Web service takes place.

    I just want that when you call a web service method, I will return the result.

    Please try this out for a WebService call

    var xmlhttp;
    xmlhttp = new XMLHttpRequest();
    xmlhttp.open("get","your url",true);
    xmlhttp.setRequestHeader("Accept","application/json");
    xmlhttp.setRequestHeader("Content-type", "application/json");
    xmlhttp.onreadystatechange=function() {
     if (xmlhttp.readyState==4) {
      if (xmlhttp.status == 200) {
        console.log(xmlhttp.responseText);
      }
     }
    }
    xmlhttp.send();
    

    This will display the result of the invocation of webservice. The url is the application that you deploy and the type can be get/post. If xmlhttp.send (post) takes argument for the display of the data. You can call it by clicking a button in HTML.

  • How to call the procedure type table

    Hi I have the below requirement

    Created in the sub table type

    CREATE or REPLACE the TYPE char_type IS the TABLE OF VARCHAR2 (4000);

    create or replace procedure test_proc_type (p_type char_type) is

    Start

    I'm looping 1.p_type.count

    dbms_output.put_line (p_type (i));

    end loop;

    end;

    How to call the procedure with parameter as a type!

    SQL> create or replace type  char_type as table of varchar2(4000)
      2  /
    
    Type created.
    
    SQL> create or replace procedure test_proc_type (p_type char_type)
      2  is
      3  begin
      4    for i in 1..p_type.count loop
      5      dbms_output.put_line (p_type(i) ) ;
      6    end loop;
      7  end;
      8  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL>
    SQL> exec test_proc_type(char_type('A','B','C','D','E'))
    A
    B
    C
    D
    E
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    Hi all

    How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    F2 does NOT an on-screen BIOS setting.

    Is there another trick?  Or, perhaps, defining the procedure step by step to start the BIOS?

    TIA

    Power on the laptop and all logo HP being displayed, press F10.

  • How to call the variables of the scene inside movieClips

    How to call the variables of the scene inside movieClips

    One way would be to use "MovieClip (root)" to target variables in the main timeline... MovieClip (root) .someVariable = someValue;

  • How to clean the adf on my officejet pro 8600

    How to clean the adf on my officejet pro 8600?

    For paper choose questions see solution three in the paper here.

    If you encounter problems with a vertical black line in the copies or scans from the ADF, then clean the thin glass on the left side of the bed as discussued in the present document.

  • How to call the function

    Hello

    How to call functions defined by the user in the select statement.
    I have to concat all the result of columns, though kindly help me.

    When I run after sql statement


    SELECT orgin_pos. «, » || the sender | «, » || consigneename | «, » || vesselname | «, » || travelno | «, » || POS | «, » || ETD | «, » ||
    ETA | «, » || NOP | «, » || grossweight | «, » || CCube | «, » || ccontainer | «, » || CSize. «, » || CType | «, » || Goh | «, » || HBL | «, » ||
    get_sea_report (hbl) linername | «, » || CompanyName AS overseasagent
    OF vietanam_report_view_bd



    -of cluase not found where expected error is coming.
    Kindly help me.

    concerning
    Prakash P
    Handle:  808542
    Status Level:  Newbie
    Registered:  Nov 8, 2010
    Total Posts:  69
    Total Questions:  48 (45 unresolved)  
    
  • How to call the OFA PL/SQL procedure.

    Hello

    I'll call the pl/sql stored procedure of the OAF page (AM). the procedure is content parameter 3 IN 1 OUT parameter. all the parameters of character type is integer.


    I put the output parameter and it's returning the value, but I don't have how to configure the setting IN because the settings IN, I need to convert the INT data type number in java.

    Please help me.


    int in_parm1 = 0;
    Number in_param;
    Request_id number;
    request_id = new Number (0);
    getDBTransaction () .commit ();
    TXN OADBTransaction = getOADBTransaction();
    int l_user_id = txn.getUserId ();
    int l_resp_id = txn.getResponsibilityId ();
    int l_resp_appl_id = txn.getResponsibilityApplicationId ();
    Number of ln_user_id = new Number (l_user_id);
    Number of ln_resp_id = new Number (l_resp_id);
    Number of ln_resp_appl_id = new Number (l_resp_appl_id);
    CallableStatement cs = txn.createCallableStatement ("start oaf_request(:1,:2,:3,:4); end; ", 1) ;
    Try
    {
    System.out.println ("run ahead");
    cs.registerOutParameter (3, Types.VARCHAR, 0, 100);
    cs.registerOutParameter(1,in_param);
    cs.registerOutParameter(4,Types.NUMERIC);
    DSI Execute();
    in_parm1 = cs.getInt (4);
    request_id = new Number (in_parm1);
    System.out.println ("Request ID" + in_parm1);
    System.out.println ("run after");
    DSI Close();
    System.out.println ("result");
    }
    catch (System.Exception e)
    {

    throw OAException.wrapperException (e);

    }

    I would tell you to go through the "appeal of PL/SQL procedures and functions" Section in the User Guide.
    Example and the details are there reference.

    Thank you

  • How to call the function cascade BlackBerry

    I begineer in blackberry c ++.

    I do two class is testobject and second in test .i call the onther text function average () and nexttext();

    so please how to call this function.

    // Default empty project template
    #include "TestObect.hpp"
    
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    TestObect::TestObect(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // set created root object as a scene
        app->setScene(root);
    }
    
    void TestObect::test(){
    
        qDebug()<< "****************Naveen";
    }
    

    I insert also declared in the header file.

    Q_INVOKABLE Sub test();

    then I create another test class.

    /*
     * test.cpp
     *
     *  Created on: Apr 2, 2013
     *      Author: nksharma
     */
    
    #include "test.h"
    
    test::test() {
        // TODO Auto-generated constructor stub
    
    }
    
    void test:: nexttest(){
        qDebug()<<"***********Next test*********"
    
    }
    test::~test() {
        // TODO Auto-generated destructor stub
    }
    

    error in the file namespace,

    here in file herder

    the namespace error

    /*
     * test.h
     *
     *  Created on: Apr 2, 2013
     *      Author: nksharma
     */
    
    #ifndef TEST_H_
    #define TEST_H_
    
    class test {
    public:
        test();
        virtual ~test();
         Q_INVOKABLE void nexttest();
    };
    
    #endif /* TEST_H_ */
    

    You have a space between the colon and the n in:

    void test:: nexttest()
    

    Another thiing, if you are using Q_INVOKABLE, you must declare Q_OBJECT in your front header file public:

     


    If you're still having problems, try to clean up the project with Project > clean...

  • How to call the PL/SQL of EntityImpl procedure

    Hello

    I have a page that can create/update visitors. When a new customer is created themselves, a line gets inserted into the database table. I use EO for this feature.

    I need to create lines to two or three other table also when a new line is created in the main table. What is the best practice for this feature?

    The 2 options that I know:

    1 create a trigger on the main table and the appeal of trigger for inserting rows in other tables.

    2. call a PL/SQL of EntityImpl procedure after the permanent data is committed to the table. (If this is the best approach, could you please let me know how to get there)

    See you soon

    AJ

    In fact, Java Mail API is included in WLS and JDev, then you can simply add %MIDDLEWARE_HOME%\Oracle_Home\oracle_common\modules\javax.mail_2.0.0.0_1-4-4.jar to your project.

    Dario

Maybe you are looking for

  • 9.3.3 iOS and Windows XP, iTunes error 80090326

    9.3.3 iOS and Windows XP, iTunes error 80090326 Run the latest version of iTunes 32bits version 12.1.3.6 Windows XP SP3 iPhone 4 running iOS 7.1.2 can connect to iTunes without problem iPhone 4 running iOS 9.3.3 s cannot connect to iTunes: error 0 x

  • DVD drive cannot read DVD - RW

    Hello This is my first time on the forum. Not used! I have a question. my dvd player reads and read DVDs, but when it comes to simple dvd rw it doesn't recognize or burn it on a dvd - rw. any suggestions?

  • I need a keyboard for a Satellite P10 504 reference number

    Some of the keys on my keyboard have stopped working and I think it's the bust. I have spent a lot of tie to searching the Internet for a new party, but I can't find the spare part. Can someone help me or give me a link, I'd be grateful extremelly!

  • CN557A: Parts for CN557A

    Hello I need to find a back cover replacement for a HP CN557A (the cover that is directly under the help of the product labels and serial number. I have tried to look on the HP part surfer, but cannot find the component. Can anyone help? Thank you Mi

  • Windows 7 64 bit HP will not be in hibernation

    Hello _M_a_t_tT, Thanks for the return of the response.  Follow the steps below to remove SP1.  Please let us know status with Hibernate after have. How to uninstall Windows 7 Service Pack 1 (SP1) http://Windows.Microsoft.com/uninstallwindows7sp1 Not