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

Similar Messages

  • 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

  • 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

  • Weird Problem calling Stored Procedure using JDBC

    Scenario is..
    I have J2EE application and calling stored procedure using JDBC.
    My application connects to instance "A" of testDB.
    Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
    In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
    The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
    Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
    Thanks

    Hi,
    I assume these are PL/SQL packages and that the changes are made at the package specification level?
    If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
    Kuassi http://db360.blogspot.com

  • Calling Stored Procedures through JDBC

    Hello!
    I would like to implement a call to a stored procedure through JDBC. This call I suppose to embed in JavaBean to import Bean as model.
      A) Shoud this call be implemented inside ordinaly JavaBean or inside EJB?
      B) How can I determine DataSource? Is it possible through JNDI?
      C) Is there any tutorials or examples?
      D) Could anybody give some code texts on this theme?

    we use quite a similar architecture here (2 ORACLE DBs, a DB link from one instance to the other). However, we use the db links in functions (not in stored procedures). but a simple select using the db link also works with JDBC. do you use the very same db instances / schemas / users+passwords on all your different test environments? so far, we havent' noticed any problems with ORACLE queries (stored procedures, functions, etc.) that work in sqlplus/worksheet but not with JDBC. do you use the latest ORACLE JDBC drivers (9.2.0.3)?

  • Creating and calling stored procedure using jdbc

    When I try to create and call a stored procedure using JDBC a very confusing error message about non-existence of the procedure just created is thrown. Using Informix database (IDS 10). Any pointers to point out what am doing wrong would be great!
    Thanks
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Scanner;
    public class CreateStoredProc {
    public static void main(String args[]){
    if (0 == args.length)
    return;
    try {
    Class.forName("com.informix.jdbc.IfxDriver");
    Connection conn = DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");
    String q = " create procedure runproc() "+
    " define i int; "+
    " let i = 0; "+
    " end procedure; "+
    " execute procedure runproc(); ";
    Statement stmt = conn.createStatement ();
    stmt.execute (q);
    } catch (Exception e) {
    e.printStackTrace();
    The stack trace:
    java.sql.SQLException: Routine (runproc) can not be resolved.
    at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3204)
    at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
    at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
    at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
    at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2157)
    at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2132)
    at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:378)
    at com.informix.jdbc.IfxStatement.a(IfxStatement.java:1299)
    at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1269)
    at com.informix.jdbc.IfxStatement.c(IfxStatement.java:989)
    at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:875)
    at CreateStoredProc.main(CreateStoredProc.java:37)
    Caused by: java.sql.SQLException
    at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
    at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
    ... 10 more

    DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");check with ur sys admin wheather the particular user in the database has >execute privilage(rights) also.i mean execute the SP in the DB level.I guess that a root user will have the enough right.
    String q = " create procedure runproc() "+
    " define i int; "+<" let i = 0; "+
    " end procedure; "+
    " execute procedure runproc(); ";
    Statement stmt = conn.createStatement ();
    stmt.execute (q);Try to use the following code:
    String q = " create procedure runproc() "+
    " define i int; "+
    " let i = 0; "+
    " end procedure; "
    Statement stmt = conn.createStatement ();
    stmt.execute (q);
    q=" execute procedure runproc(); ";
    stmt.execute (q);
    Because maybe the driver failed to precompile your sql once, so that nothing happen.

  • Call stored procedure in JDBC passing Array parameters

    Hi all,
    Im trying to call an Oracle Stored Procedure with JDBC. The problem is
    that my parameter is an Array (PL/SQL Type is "Table Of").
    How can i call this procedure by passing right Java parameters to
    the Callable statement ??
    In the Documentation, all samples don't work ! it's possible to
    call a procedure that return Array Type but when we need to pass an Array as
    a parameter we have a DataType exception.
    Any idea ?
    thanx in advance
    Sam.

    Hi Sam,
    I don't have an answer to your question, just some suggestions as to
    where else you may find help.
    Do you know about the "Ask Tom" website:
    http://asktom.oracle.com
    Also, you may find something in the comp.databases.oracle.* newsgroups:
    http://groups.google.com
    I found this article there -- but it's not exactly what you're looking
    for:
    http://groups.google.com/groups?q=array+group:comp.databases.oracle.server+author:Thomas+author:Kyte&hl=iw&as_qdr=w&selm=a9sg06027kf%40drn.newsguy.com&rnum=1
    Good Luck,
    Avi.

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

  • 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

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

  • 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

Maybe you are looking for

  • Invoice posted in 2006 by mistake, no accounting document generated

    Dear Expert The user created an invoice by mistake on today's date , but billing date was 2006. as the periods are closed , it did not create any accounting document. now when the user realized his mistake he made cancellation of the invoice in the s

  • I got the iphone iOS 7.1.1 update and now my music won't play and I can't download apps. Can I fix it?

    When i got the update at first the music would play while my headphones were in. I restored my iphone and now it won't play at all. I have tried to go in the settings for itunes and app store but it also won't load.

  • Memory Leak with JPopupMenu

    It seems there is a memory leak with JPopupMenu. The following program demonstrates this leak. If you run the program, click on show form, and then close the form, the used memory will be GCd appropriately. If you click on show form, then right click

  • IWork 09 will not update

    I have iWork 09 DVD version and am running Yosemite. The app store and the applications both say there are updates available. When i go to run the update for either of the 3 applications i get the following message: Update unavailable with this Apple

  • Extract filter in CS5 (Mac)

    I just got CS5 last week and I'm trying to use the Extract filter but can't seem to find it anywhere. If I remember correctly, I had to download the plugin for CS4 but I don't see anything for CS5, only for Windows. What's up with that? Can anyone te