Invoke stored procedure from JDBC Adapter

Is there a tool that generates interfaces for stored procedure(ORACLE PL/SQL) like RFC or IDOC adapters?

Hi Denis,
I dont think there is any such tool.]
To generate a Stored Procedure of your Oracle DB, all you will have to do in your <b>JDBC adapter configuration</b> is give the name of the Stored Procedure under <Table> and you will have to give "<b>execute</b>" as the value under action attribute.
Just check this link. Hope it helps,
http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/content.htm
Just check this blog of Sriram wherein a stored procedure of a MaxDB Database is called.
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
I have implemented a scenario which requires an Oracle stored procedure to be executed and so, if you do need any further info, let me know.
Hope this info helps,
Regards,
Bhavesh

Similar Messages

  • Invalid Object when Calling Stored Procedure from JDBC Adapter

    JDBC Outbound adapter in XI 2.0 connected to SQL Server.  I've coded my mapping to format the XSL mapping properly but the Adapter appears to not be able to find the Stored Procedure.  Error message returned is "Invalid Object spStoredProcedureName".
    Does anybody have any clue as to what I'm missing???

    I know this is trivial, but did you use the "full" name of the SP as <schema>.<procname>???
    HTH

  • Calling Stored Procedure from JDBC Adapter

    Hello,
    I am Updating a SQL Server Table using JDBC Adapter.
    Now I have multiple input rows and the procedure needs to be called for each set.
    Do I need to use multimapping for this or just generating multiple <b>Statement</b> node will solve?
    Also For this will there is any knows/ forseen problem (like Transaction handling) that I need to take care of?
    Thanks and Regards,
    Himadri
    Message was edited by:
            Himadri Chakraborty

    Himadri,
    You can just create multiple statement nodes in one message.
    I am not aware of any known or foreseen issues with this approach.
    Kind regads,
    Koen

  • Error while invoking stored procedure from BPEL process

    Hi Folks,
    I am facing the below mentioned issue while invoking a stored procedure in BPEL process :
    I am trying to invoke a stored procedure from a BPEL process. The process runs fine for the first/second time, but gives the below error after that whenever i try to run the process :
    file:/oracle/orasoa/bpel/domains/default/tmp/.bpel_ProvisionOrderASAPReqABCSImpl_1.0_50dd1595129e9bbb00560e31e7c18cef.tmp/DB_CALL_GetPendingSubscriptionProc.wsdl [ DB_CALL_GetPendingSubscriptionProc_ptt::DB_CALL_GetPendingSubscriptionProc(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'DB_CALL_GetPendingSubscriptionProc' failed due to: Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the PROC_GET_PENDING_SUBSCR API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    ; nested exception is:
    ORABPEL-11811
    Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the PROC_GET_PENDING_SUBSCR API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
    I am not getting how the BPEL is referring to the DB wsdl from the tmp folder. To resolve this issue, we have to stop the SOA server, delete the tmp files, and restart the server.
    Any pointers in this regard will be really helpful.

    First of all does this scenario occur again.
    "Works first/second time. Later gives this error."
    After you restart the SOA server are you able to reproduce this scenario?
    As already pointed out and from the error message, database connection is reset.
    If you find this error again, try this out.
    em -> home / oc4j_soa -> Administration -> JDBC Resources
    Use the "Test Connection" option for the Connection Pool that you are using for your database JNDI.
    It comes back and say "Connection to "XYZCP" established successfully." it is good to use.
    Run the BPEL process again and once you find the error, come back and test the connection.
    If it comes back with Error, diagnose based on the error message received.
    Cheers
    Kalidass Mookkaiah
    http://oraclebpelindepth.blogspot.com/

  • XSQL: how to invoke stored procedure from XSQL

    Any one has example on how to invoke stored procedure within XSQL with associated *.xsl? What the syntax looks like? Thanks.

    If you want to simply invoke a stored procedure, use:
    <xsql:dml>
    begin
    proc(args);
    end;
    </xsql:dml>
    If you want to return XML that your stored procedure "prints" to the OWA page buffer, then use:
    <xsql:include-owa>
    If you want to invoke a stored function that returns a REF CURSOR function, then use <xsql:ref-cursor-function>
    null

  • Error while calling stored procedure from apps adapter

    Hi,
    I am calling Oracle applications standard api to create ar invoice (XX_BPEL_TEST_APPS_ADAPTER_PKG is the name of wrapper package created by adapter) from apps adapter but getting the following error:
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'test_apps_adapter' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG.AR_INVOICE_API_PUB$CREATE_SIN API. An error occurred while preparing and executing the APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG.AR_INVOICE_API_PUB$CREATE_SIN API. Cause: java.sql.SQLException: ORA-06531: Reference to uninitialized collection ORA-06512: at "APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG", line 199 ORA-06512: at "APPS.XX_BPEL_TEST_APPS_ADAPTER_PKG", line 909 ORA-06512: at line 1 Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-6531" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    Just wondering if anyone has faced a similar problem?

    I am trying to pass parameter to test my procedure but it is giving this error : ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 12
    Here is example for my test procedure:
    declare
    v_session_id_tab SESSION_ID_TAB_TYPE;
    v_service_type_tab SERVICE_TYPE_TAB_TYPE ;
    v_service_location_tab SERVICE_LOCATION_TAB_TYPE ;
    v_service_call_name_tab SERVICE_CALL_NAME_TAB_TYPE;
    v_service_call_start_time_tab SERVICE_CALL_ST_TAB_TYPE;
    v_service_call_end_time_tab SERVICE_CALL_ET_TAB_TYPE;
    v_service_call_duration_tab SERVICE_CALL_DUR_TAB_TYPE;
    v_status_tab STATUS_TAB_TYPE;
    v_notes_tab NOTES_TAB_TYPE;
    begin
    v_session_id_tab(1) := 1;
    v_service_type_tab(1) := 'db';
    v_service_location_tab(1) := 'local';
    v_service_call_name_tab(1) := 'Name of call';
    v_service_call_start_time_tab(1) := SYSDATE;
    v_service_call_end_time_tab(1) := SYSDATE;
    v_service_call_duration_tab(1) := 100;
    v_status_tab(1) := 'Z';
    v_notes_tab(1) := 'NOTES';
    BULK_INSERTS (v_session_id_tab,v_service_type_tab, v_service_location_tab,v_service_call_name_tab,v_service_call_start_time_tab,v_service_call_end_time_tab,
    v_service_call_duration_tab, v_status_tab, v_notes_tab);
    end;
    I declare all types at schema level.
    Please give your comments.
    Thank you

  • Calling a Stored Procedure with JDBC Adapter ?

    I'm trying to call a Stored Procedure in my XI 3.0 JDBC adapter, but I get an "...invalid number of parameters...." error.
    Does anyone have an example of a Query SQL Statement and the corresponding Stored procedure?
    This is my test code. Eventually I would like to return a resultsett from the stored procedure.
    Query SQL Statement:
    call Sp_sapxi( 'F1' , 'xx' )
    Stored Procedure:
    CREATE OR REPLACE PROCEDURE Sp_sapxi (
      transtype_in IN      xi_flaggtest.TRANSTYPE%TYPE,
      status_in    IN      xi_flaggtest.STATUS%TYPE)
    IS
    BEGIN
      UPDATE xi_flaggtest
                 SET status = status_in
               WHERE transtype = transtype_in;
    END;
    Regards,
    Elling

    you can clear the field key tags mandatory in the XML Schema interpreter parameter and make the Empty string value to Empty string from null value.
    For mapping : you can pass a value that is of the same format of date; but you can take your own value in the database since you are parsing the date format from one to other
    thanks
    nikhil

  • Calling Stored Procedure from JDBC MSSQL

    Ok, I have a stored procedure on a MsSQL Server 2000 data base. I need to call it to encrypt/decrypt passwords, my problem is when I run it from Query Analyzer it works fine but not in JDBC land. Below I have included my code. I have read you need to use a callable statement, but my query has a proc call embedded in it, not just a proc call. Anyone know how this would be accomplished?
    THanks in Advance
    try {
                   // create an insert query
                   StringBuffer query = new StringBuffer();
                   // add strings and variables to query
                   query.append("INSERT INTO ");
                   query.append("users (Company, FirstName, LastName, Username, ");
                   query.append("Password, Email) ");
                   query.append("values(");
                   query.append("'" + form.getCompany() + "', ");
                   query.append("'" + form.getFirstName() + "', ");
                   query.append("'" + form.getLastName() + "', ");
                   query.append("'" + form.getUsername() + "', ");
                   query.append("dbo.fn_sys_encryptpwd('" + form.getPassword() + "', '" + key + "'), " );
                   query.append("'" + form.getEmail() + "')");
                   // get the datasource from the From the context
                   DataSource dataSource = ResourceLocator.getRCDataSource();
                   // open a connection
                   Connection conn = dataSource.getConnection();
                   // make a statement and execute it
                   CallableStatement statement = conn.prepareCall(query.toString()) ;
                   //Statement statement = conn.createStatement();
                   statement.execute();
                   // Insert has been performed...destroy the statement and connection.
                   statement.close();
                   conn.close();
              }

    I tried with Statement first then I tried with the PreparedStatement, but neither one worked. I have inlcuded part of the stackTrace to give you an idea of my problem
    Thanks
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'dbo.fn_sys_encryptpwd'.
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
    Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
    Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(
    Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Sour
    ce)
    at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType
    (Unknown Source)
    at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown
    Source)
    at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
    at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown
    Source)
    at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
    at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
    at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(Deleg
    atingPreparedStatement.java:168)
    at com.retailcode.web.data.dao.LoginDAO.createLogin(LoginDAO.java:81)
    at com.retailcode.web.submit.SubmissionServlet.postRegister(SubmissionSe
    rvlet.java:226)
    at com.retailcode.web.submit.SubmissionServlet.doPost(SubmissionServlet.
    java:47)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
    rocessConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
    int.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
    lowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
    ool.java:684)
    at java.lang.Thread.run(Unknown Source)

  • How to call Packaged Stored Procedure in JDBC Adapter?

    hello frnds,
    I m working on a SAP R/3 -> XI -> Oracle scenario. Here on receiver side i m using JDBC Adapter in which i m using a stored procedure.
    I have my stored procedure in a Package. Example : package "PKG_SPARES_VOR_UPLOAD" and in that stored procedure "pr_spares_vor_po_hdr_upload".
    i have checked that if i write this stored procedure outside the package then it works fine... but if i put it into the package then it is giving me error that ....
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 11:02:04 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PR_SPARES_VOR_PO_HDR_UPLOAD' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier 'PR_SPARES_VOR_PO_HDR_UPLOAD' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored ".
    please help me out with this problem.
    Thankx,
    Regards,
    Audumbar

    Hi,
    I have the same problem to call a stored Procedure in a Package.
    If my procedure is not in a package, everything is right.
    And I musn't indicate all the name, because I musn't put '.' in the name (of the procedure), in my DT on XI.
    It would be so nice to have an answer.
    Rémi

  • Calling Stored Procedure without JDBC-Adapter

    Hallo,
    as it is not possible calling Stored Procedures with the parameter Typ Record in Oracle my question: It is possible connecting to DB using native java-code for example in Mapping?
    Thanks in advance,
    Frank

    Hi Frank,
    Maybe you can use the DB look up using the JDBC adapter in your mapping.
    Just check this blog for the same,
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    As for calling an Oracle Strored Procedure, it is possible using a RECEIVER JDBC adapter, but not a SENDER JDBC adapter.
    <i> import the jdbc-driver (oracle) in an archive in Designer.</i>
    Also, this imported archive should be under any Namespace, but, it should be in the same SWCV as the one in which the mapping is being executed.
    Regards,
    Bhavesh

  • Urgent! Call stored procedure from jdbc vs. call from sqlplus?

    Hello I met a strange problem when using JDBC (to Oracle). I have a stored procedure mypack.myproc, which updates a table (only one row and one column in the table). I found that when I called the procedure directly from sql*plus, like:
    ==========
    BEGIN
    mypack.myproc;
    END;
    ==========
    the value is 2, which is correct.
    However, if I call the procedure from with in java via jdbc, the value become 591 (which is ridiculous), the jdbc call looks like:
    ================
    cstmt = con.prepareCall("{call mypack.myproc}");
    cstmt.executeUpdate();
    con.commit();
    ================
    This is really wield, Any idea?
    Thanks

    Hey buddy, it's you again. Just let you know that you are right. The problem is caused by mis-match between jdbc date and oracle date (that procedure is used to do some date calculation). My co-worker suggested me to add this statement in the procedure, and it did solved problem:
    ================
    DBMS_SESSION.SET_NLS( 'NLS_DATE_FORMAT', '''DD-MON-RRRR''' );
    ================

  • Stored procedures and JDBC Adapter

    Hey guys ,
    any blog where i canlook up w.r.t. working with  any stored procedure through xi ?
    Appreciate ur help.
    Krishna

    Hi Krishna,
    Here you go-
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Also remember that, Sender JDBC Adapter doesnot support Oracle Stored Procedures. Because Sender JDBC Adapter sends resultset to XI. But Oracle stored procedure returns Cursor.
    I think, if you are using other database then it may support.
    Regards,
    Moorthy

  • TimeStamp in Stored Procedure for JDBC adapter

    Hi,
    I have a Date Timestamp field (DD/MM/YYYY HH:MM:SS) in my stored procedure (target system), how do I pass an empty value when there is no date coming from the source system.
    I am able to send the date field in the format when I get the date timestamp field in the source message but sometimes the date field will be empty in the source message, where in I have a issue to pass to stored procedure.
    Error details - java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string ORA-06512: at line 1
    Thanks.
    Yeshwanth

    but sometimes the date field will be empty in the source message, where in I have a issue to pass to stored procedure.
    Why not to avoid creating the DATE field in the target when the source is empty or not present? Just make a check on the source field....check if it is not-blank and then only create the target node....if the source field is blank then the target wont be created and hence wont be inserted into the DB....check if this works for you.
    Also check the XML Schema Interpreter (Interpretation of Empty String Values) section from this help section:
    http://help.sap.com/saphelp_nw70/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Jul 16, 2010 3:23 PM

  • Stored procedure from JDBC in VC

    Hello
    We're starting to use VC 7.0 SP14.
    We've already made few applications using JDBC tables or view and BAPI.
    Now we want to use stored procedures of the same DB.
    Our DB system was created as a "SAP_BI_JDBC". But when I look in VC, I can see my system but it only proposes me to "look for a table" or to "browse table catalog". Here I don't see my stored procedures.
    Hence, I tried to create a "JDBC Systems" but now I can connect to it (connection test fail).
    Can any one help by giving me the parameters to use on the DB side, or portal's system parameters, ...
    Thank you !
    Benoit

    Hi,
    You test the Connection in the prortal if it fails then it is problem woth Usermapping.
    Do the usermapping for that DB
    then try again
    Govindu

  • How to pass RECORD input type to stored procedure from JDBC?

    Hi,
    We have stored procedure which takes RECORD as input .
    We could execute the below script from oracle client tool and get the response.
    declare
    l_record app.batch_update.add_record;
    l_id number;
    begin
    -- memberNumber
    l_record.no := '123456700';
    -- Policy Number
    l_record.pno := '1234567'
    -- Status. This will always be NEW.
    -- Call to API to add record
    app.batch_update.add_request
    (p_record => l_record,
    p_id => l_id,
    end;
    We have requirement to construct RECORD input from Java application and pass it to callable statement.
    We have tried to construct it via STRUCT and pass it to callable statement but it didn't work.
    We have constructed it like the following but not sure whether it is correct. It was throwing error "java.sql.SQLException: invalid name pattern: app.batch_update.add_record
    StructDescriptor structdesc = StructDescriptor.createDescriptor
    ("app.batch_update.add_record", delConn);
    Object[] p1obj = {' 12345','124050'};
    STRUCT p1struct = new STRUCT(structdesc, delConn, p1obj);
    Not sure whether I am doing the logic correctly.
    Please point me to the correct approach.
    Thanks in Advice
    Thanks

    Wrap the method using a record-type parameter in PL/SQL; a simplified example follows. Add exception handling, translation of types etc. as needed.
    CREATE OR REPLACE PROCEDURE prc_wrap_prc_using_rec
    pv_my_field_01 IN VARCHAR2,
    pv_my_field_02 IN VARCHAR2,
    pv_my_field_99 IN VARCHAR2,
    pv_err_msg OUT VARCHAR2
    ) AS
    -- Non-scalar parameter
    pr_my_record user.pkg_rec_declarations.wr_a_record_decl;
    BEGIN
    -- Load the work record
    pr_my_record.pv_field_01 := pv_my_field_1;
    pr_my_record.pv_field_02 := pv_my_field_2;
    pr_my_record.pv_field_99 := pv_my_field_99;
    -- Call the procedure
    pkg_std_routines.prc_do_sumfin(pr_my_record, pv_err_msg);
    END;

Maybe you are looking for