JDBC  Adapter Stored Procedure Query

Hi All,
I hav a scenario where i hav to call a Stored procedure. The stored procedure returns 3 result set objects (in other words, has 3 select statements). I had configured a JDBC Sender adapter which contains the Execute statement of the Stored Procedure. When i run this scenario, i'm not getting anything displayed on the SXMB_MONI. the adapter is in green color in the Adapter monitor.Can any one help me out in this regard?
Thnx in Adv
Anil

Anil,
Did you check your Data Type is created correctly ?
And check the link, I have provided.
And first try to retrieve the 1 resultset. And check is it coming to XI.
Also check in the RWB->Message Monitoring->Select the Criteria->Audit Log.... You can check is there any error..
Just look into this also-DataType definition for when using JDBC sender adapter
configuring jdbc adapter with multiple tables
Hope this helps,
Regards,
Moorthy

Similar Messages

  • Sender JDBC Adapter - Stored procedure

    Hello all, I just read a lot of topics in this forum about this subject.
    I found two indications in contracdictions in the documentation :<a href="http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm">Configuring the Sender JDBC Adapter</a>
    1. Concerning Query SQL Statement
    You have the following options:
    &#9679;     Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
    &#9679;     Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    2. Concerning Update SQL Statement :
    This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.
    It is ambigous, isn't it ?
    My question is simple :
    Does somebody already use Sender JDBC Adapter with Stored procedure as Select statement including many steps :
    - update actions on database
    - select query to return data to XI adapter
    (Update statement stay empty or with value <TEST>.
    To provide more information, I have a reference table to read. But this reference table must be updated by a stored procedure before being able to be read accordingly.
    So As I can't do both process with Sender Adapter (call a procedure and execute a select statement) => I want to include both actions (updates and select) in an alone stored procedure.
    Could I get wanted data as a resultset ?

    Hi,
    >><i>Update statement stay empty or with value <TEST>.</i>
    It should be <TEST> if you do not want an Update to happen.
    Regarding Sender JDBC adapter with stored procedures, which DB are you trying to access. Sender JDBC adapter does not support Oracle Stored Procedures as they return Cursors and Sender JDBC adapter can deal with only Resultset.
    As for executing both Update and Select in the SP, though I havent tried, this should surely be possible.
    Regards,
    Bhavesh

  • JDBC Adapter stored procedure call

    Hi All,
    I have a requirement of calling stored procedure through Reciever JDBC Adapter, where in multiple records are to be provided as input at a time, also multiple records should be recieved at a time.
    Can any one tell me how the structure of data type should be.
    Thank in Advance,
    With Regards,
    Zafar Ali

    Hello Ali,
                     At structure level, the root node should set to  0..unbound as we intend to process multiple records, if the records are having same structure.
    [Jdbc scenario|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417800)ID1319542550DB11163633639799272972End?blog=/pub/wlg/1772]
    Regards,
    prasanna

  • JDBC adapter Stored Procedure error: parameter was not supplied

    I am trying to call a Stored Procedure 'SP_FUSION_DEBMS_ADRC_MANAGE_CUSTOMER_ADDRESS' in our SQL Server database.
    XI 3.0 Sp13
    Jdbc Url: jdbc:microsoft:sqlserver://161.241.255.91:1433;databaseName=FusionDB;SelectMethod=Cursor
    I am getting following error:
    beging of error-----
    Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_FUSION_DEBMS_ADRC_MANAGE_CUSTOMER_ADDRESS' (structure 'Statement1'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Procedure 'SP_FUSION_DEBMS_ADRC_MANAGE_CUSTOMER_ADDRESS' expects parameter '@control_no', which was not supplied.
    End of error-----
    I have defined the field "control_no" in the interface defenition but I am not sure what causing this error, error message is mis-leading.
    Please let me know if you have any hints/comments?
    thanks,
    Laxman molugu

    Hi Laxman,
    maybe you have checked this already...from the following help link....DECIMAL might be something you might want to try out....
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    <i>action=EXECUTE
    Statements with this action result in a stored procedure being executed. The name of the element is interpreted as the name of the stored procedure in the database. If you use the optional <table> element, the value specified here is used as the stored procedure name. This enables you, for example, to define stored procedure names containing non-XML-compatible characters or characters that prevent them from being used in interface definitions in the Integration Builder/PCK.  If specified, <table> must be the first element in the block within <dbTableName>.
    The elements within the stored procedure are interpreted as parameters. They can optionally have the attribute isInput=“1“ (input parameter) or isOutput=“1“ (output parameter) or both (INOUT parameter). If both attributes are missing, the element is interpreted as an input parameter. The parameter names must be identical to those of the stored procedure definition.
    The attribute type=<SQL-Datatype> , which describes the valid SQL data type, is mandatory for all parameter types (IN, OUT, INOUT).
    The following SQL data types are supported:
    INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output),CLOB (input and output), CURSOR (output; only in conjunction with the Oracle JDBC driver).</i>

  • JDBC Adapter - Stored procedure

    We r using JDBC adapter to do some DML operations on SQL DB tables. We got some errors.
    Now we have decided to use a stored procedure for the same.
    Any ideas on this. Any source is appreciated.
    -Naveen.

    Hi Naveen,
    First refer this blog-
    http://help.sap.com/saphelp_nw04/helpdata/en/45/023c41325fa831e10000000a1550b0/frameset.htm
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Hope this helps,
    Regards,
    Moorthy

  • SQLJ vs JDBC vs stored procedur?People

    SQLJ vs JDBC vs stored procedur?
    What is used in the enterprise?
    What to study?

    SQLJ and JDBC are ways to access the database - from the client, from the middle tier, or from inside the database server itself.
    JDBC is an API specified by Sun as part of Java, while SQLJ is an ANSI (soon ISO) standard for embedding SQL in Java.
    JDBC is more widespread, while SQLJ is a more productive environment.
    Stored procedures are pieces of code executed in the database as part of your database session. In Oracle Databases, stored procedures are usually written either in PL/SQL (a propertietary Oracle language) or in Java. If you write your stored procedure in Java you use JDBC or SQLJ to access the database - essentially the same code you would write on the client or in a middle-tier.

  • JDBC(using stored procedure) to RFC Scenario

    Hi
    I am doing JDBC(using stored procedure) to RFC Scenario
    While running the scenario i am getting the following error
    Database-level error reported by JDBC driver while executing statement 'EXECUTE EMU.EXTRACTRECON'. The JDBC driver returned the following error message: 'com.ibm.db2.jcc.a.SqlException: [ibm][db2][jcc][10100][10910] java.sql.Statement.executeQuery() was called but no result set was returned. Use java.sql.Statement.executeUpdate() for non-queries.'. For details, contact your database server vendor.
    Can anybody sortout my problem
    Regards
    sunilreddy

    Hi,
    i am doing the scenario file to rfc scenario.
    when i run my scenario xi system is picking the data from file system
    but rfc is not accepting the data.this is the error i am getting
    Delivery of the message to the application using connection RFC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Exception thrown in method process. The transaction is marked for rollback.: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback..
    so please any one give me the solution for that

  • JDBC Receiver Adapter - Stored Procedure - Error Illegal Parameter

    Hi experts,
    I have a problem with the next scenario:
    HTTP <-> XI -> JDBC
    XI sends the following message to JDBC Adapter in mode Receiver to execute a Stored Procedure in a Informix database:
    <ns0:mt_messageTestSP xmlns:ns0="urn:test">
      <statement>
        <hastus_exporta_dia action="execute">
          <fechaEnvio isInput="true" type="DATE">11/17/2008</fechaEnvio>
        </hastus_exporta_dia>
      </statement>
    </ns0:mt_messageTestSP>
    Note: The format that accepts the SP Informix in the field of type date is: MM/dd/yyyy
    The SP is running on an Informix database, and the parameter (fechaEnvio) that receive the SP is of type DATE. At runtime the SP does not run, and in the Component Monitoring of the Runtime Workbench I see the following error:
    Unable to execute statement for table or stored procedure. 'hastus_exporta_dia' (Structure 'statement') due to java.lang.IllegalArgumentException
    Any idea?
    Thanks,
    Jose.

    Hi,
        Check the date format...once again...
    In oracle date format is DD/MM/YYYY but if the same is sent from PI its throwing the error....
    but when i send the format as DD-Mon-YYYY its accepting and showing as DD/MM/YYYY in oracle tables
    so just try fetching the date field from the informix database and see how it is get converted into..and based on that send the format
    HTH
    Rajesh

  • JDBC Receiver adapter Stored procedure

    We are using stored procedure to insert/update the data into SQL database, for this I define data type  as below
    But the JDBC call is failing with error " com.sap.engine.interfaces.messaging.api.exception.MessagingException:
    Error processing request in sax parser: Error when executing statement for
    table/stored proc. 'insert_IDOCRec' (structure 'STATEMENT'):
    java.sql.SQLException: ERROR: Invalid XML document format for stored procedure:
    'type="<SQL-type>"' attribute is missing for element 'table' (Setting a
    SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)"
    Can you please help me why the JDBC call is failing with the above error.

    I think your struct is wrong,the right is following:
    DT_INSPLOT_JDBC_REC_REQ
              STATEMENT
                        insert_IDOCRec     Element     1..unbounded
                        action                    Attribute     xsd:string     required
                        table                     Element          xsd:string     1
                        field1                      Element    1
                             isInput               Attribute     xsd:boolean     required
                             type                 Attribute     xsd:boolean     required
                        field2                      Element    1
                             isInput               Attribute     xsd:boolean     required
                             type                 Attribute     xsd:boolean     required
    from the log you send to us, the struct miss the table element.

  • JDBC receiver adapter - stored procedure response

    I am on PI 7.11 and have the following scenario:
    RFC->PI->JDBC
    whereby the JDBC receiver access an Oracle db (unsure of that version) using a stored procedure "GET_ICBC_ID".
    My issue is that I never seem to have any data back in PI on the JDBC response coming back from Oracle. ***
    Here is the definition of that stored procedure in Oracle:
    Stored Procedure Name: GET_ICBC_ID
      Parameters
                    ICBCID    OUT VARCHAR2               <- Returned RACF ID (output)
                    REQUESTOR IN VARCHAR2 default 'SAPHR'       <- Optional Requestor ID.
                   COMMUNITY IN  VARCHAR2 default 'EMP'       <- Optional Community ID. 
    Here is my JDBC call in to the stored procedure (sxi_monitor), which seems to be fine:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_racf_req xmlns:ns1="http://sap.com/xi/Z_SkillSoft">
    - <Statement>
    - <GET_ICBC_ID action="EXECUTE">
      <REQUESTOR isInput="true" type="VARCHAR">SAPHR</REQUESTOR>
      <COMMUNITY isInput="true" type="CHAR">EMP</COMMUNITY>
      </GET_ICBC_ID>
      </Statement>
      </ns1:MT_racf_req>
    It appears as though the call into the JDBC is working, as the Oracle guys have shown me the logs (showing success) on the Oracle side.
    This is my sxi_monitor entry (of that response message):
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:MT_racf_req_response xmlns:ns1="http://sap.com/xi/Z_SkillSoft">
      <Statement_response />
      </ns1:MT_racf_req_response>
    Also when I look at some of the message properties I see:
      <SAP:MessageSizePayload>0</SAP:MessageSizePayload>
      <SAP:MessageSizeTotal>13243</SAP:MessageSizeTotal>
      <SAP:PayloadSizeRequest>0</SAP:PayloadSizeRequest>
      <SAP:PayloadSizeRequestMap>0</SAP:PayloadSizeRequestMap>
      <SAP:PayloadSizeResponse>179</SAP:PayloadSizeResponse>
      <SAP:PayloadSizeResponseMap>149</SAP:PayloadSizeResponseMap>
    which I believe is saying that something came back in to PI as a response??  Not sure.
    My Message Type definition is:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.com/xi/Z_SkillSoft" targetNamespace="http://sap.com/xi/Z_SkillSoft">
       <xsd:element name="MT_racf_req_response" type="DT_racf_req_response" />
       <xsd:complexType name="DT_racf_req_response">
          <xsd:sequence>
             <xsd:element name="Statement_response" type="DT_statement_response" />
          </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="DT_statement_response">
          <xsd:sequence>
             <xsd:element name="ICBCID" type="xsd:string" />
          </xsd:sequence>
       </xsd:complexType>
    </xsd:schema>
    I have also tried inserting <row> between <Statement_response> and the ICBCID element.  Still no luck. 
    I suspect something is wrong with my response message type definition, but am not seeing it. Also, am unsure how I can debug this - it appears as though Oracle side is fine, but nothing back into PI.
    Any thoughts appreciated.
    Keith

    Thank you all for your response.  Some more info.:
    - The stored procedure is a SELECT, so am thinking I shouldn't need the <update_count> tags mentioned.  Let me know if this assumption is incorrect.
    - Because one field (ICBCID) is to be returned in the reponse, does it need to be passed in on the jdbc request ? Looking at the blogs I did not see them do that.  If so, with its IsOutput=true, or should it be IsInput=false or other? Also if it is to be passed in on the request, I guess I would set its value to a space so that the xml tag gets produced?
    - Does the order of the request elements passed matter, i.e. if the ICBCID is to be passed on the request, should it be first or last in the list?  Does order of the 2 IsInput=true parameters matter (i.e. in relation to the Stored Procedure)?
    - The Oracle version is 11.1, so pretty up-to-date.  Stored Procedures should work fine.
    - What specifically is meant be 'resultset'?  Also, does <row> need to be added as a tag within the response xml?
    Regards,
    Keith

  • Sender jdbc adapter - no update query

    hi ,
    i am using pi 731 single stack.
    the scenario is - PI has to pick data from view of a hana database. i am using jdbc sender for it.
    pi will not have access to update the table,only pi can read the view of database.So,PI can't use UPDATE query.
    If in jdbc sender channel ,I use SELECT query only and no UPDATE query - will it work ? what will happen if there are 100 records in the view and PI failed after fetching 43 records..will it pick from 44th record next time OR it will start from 0 again ?
    rgds

    Hi SAP PI,
    It has no sense to use the sender JDBC without update query because then always will be taken the same records.
    If you cant update the source DB you only have the choice to talk with the DB administrators that they develop for you a stored procedure that it has to do the work to get different records in every PI access.
    If the PI record process fail with impossible source database update update, the only way (afaik) is to do a PI alert and to communicate it to db sender administrators. There are another option like to store the data in a intermediate table, and so on but all possibilities that i can think now are not to enough good.
    Regards.

  • JDBC-FILE(Stored procedure)

    HI Experts,
    I have a requirement as follows
    stored procedure->stored procedure->File.
    ie initially a stored procedure would be executed(which i could execute with help of option in the jDBC communication channel).This would result in a resultset being given as output.
    This will be associated with sender datatype.Now this is to be given as input to a second stored procedure.
    The second stored procedure will return output which i need to map into a target file structure.
    Can anybody guide me in this regard?Sender will be JDBC and target will be file adapter,but how can i execute the second stored procedure?
    The blogs simply says the option for one stored procedure to file.Is there any other help or blogs?
    Thanks in advance

    Hi,
    According to your requirement you are clubbing three scenarios into one:
    1) Source > XI <> JDBC(SP1)
    2) Continued from (1) JDBC(SP1) >XI <> JDBC(SP2)
    3) Continued from (2) JDBC(SP2) -->XI --> File.
    Now you can decide what all objects you will need....the trick lies in how you are going to configure the Directory part for this.....
    Include the necessary conditions in Receiver Determination (for sending message in the second point mentioned).....
    The second communication should get iniated once you get some value from the call to SP1....this can be checked in Receiver Determination using the Exist (EX) condition...this will trigger the call to SP2.....same for SP2-----> File.
    Just create a single Configuration Scenario in ID for this and include all the objects in it.
    Regards,
    Abhishek.

  • Sender JDBC with Stored Procedure or Function

    Hi.
    I have a problem to update a row that I obtain from sender JDBC (using SELECT or calling to a FUNCTION).
    As the consultation is so complex and the table has fed up transactions, often it takes the registry “A” and updates register “B”.
    Try to use the level of transaction “Serializable” (/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter) but it throws the following error to me:
    "The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-08177: can't serialize access for this transaction '. For details, contact your database server vendor."
    Try to invoke to a function (/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter) but when placing a sentence of UPDATE within the function throws an error, I reviewed to me and calling to a function from a SELECT, Oracle it does not allow to modify registries of the database.
    Some other suggestion?

    Hi,
    See this link,
    Here is an example of mapping for synch JDBC.
    /people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Also go thru these links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.

  • JDBC callableStatement stored procedure call cancellation?

    up vote0down votefavorite
    I have a very complex oracle stored procedure that searches and retrieves some data. The procedure returns an output parameter - an oracle cursor. I execute the procedure by JDBC:
    CallableStatement stmt = conn.prepareCall("{call myprocedure(?,?,?,?}");
    The problem is, the queries can sometimes take quite long (few minutes) and i would like user to be able to cancel the query anytime by clicking button. I have reference to stmt object, but unfortunatelly calling stmt.cancel() (from other thread) has NO EFFECT.
    On the other hand when i change the CallableStatement sql to some query like:
    CallableStatement stmt = conn.prepareCall("select * from all_objects");
    i get "java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation" after calling stmt.cancel() - so thats the right reaction.
    Does that mean than i cannot cancel stored procedure call via jdbc, but only simple select statements? Does anyone else had and resolved similar problem?
    I guess i could cancel the query by oracle kill session, but i use connection pooling (jboss) and i have plenty of sessions for the same user existing.
    Database Product Version is Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production JDBC Driver Version is 11.2.0.4.0
    any help will be appreciated.

    This property didnt help, still no reaction after statement.cancel().
    I could not cancel the statment from the db size , so i decided to spawn new java thread and run the statement in that thread, and when user clicks cancel button i just cancel the thread, some snipper of code below:
                   AtomicBoolean userCanceled - this must be AtomicBoolean or  volatile variable, so other threads would see the change of variable after clicking button
                   try{
                    MyCallableQuery callable = new MyCallableQuery(rs,stmt,this,rsh,outParameter);
                    FutureTask<T> queryTask = new FutureTask<T>(callable);
                    ExecutorService executor = Executors.newFixedThreadPool(1);
                    executor.execute(queryTask);                 
                    while  (!queryTask.isDone()){         //stil processing statement            
                     Thread.sleep(100);
                          if (userCanceled)){               //user decided to cancel
                           futureTask1.cancel(true);
                           executor.shutdown();
                           throw new SQLException("User decided to cancel procedure call");
                     result = futureTask1.get(); 
                     //here the code after the resultset has been processed without cancelation
                   catch (SQLException e}{
                   //here the code when user decided to cancel  like clearing the datatable
    and my callable class is like:
    public class MyCallable<T> extends ProcRunner implements Callable<T> {
        private ResultSet rs;
        private CallableStatement stmt;
        private ProcRunner procRunner;
        private ResultSetHandler<T> rsh;
        private Integer outParameter;
        public MyCallable(ResultSet rs,CallableStatement stmt,ProcRunner procRunner,ResultSetHandler<T> rsh,Integer outParameter){
            this.rs = rs;
            this.stmt = stmt;
            this.procRunner = procRunner;
            this.rsh = rsh;
            this.outParameter = outParameter;
        @Override
        public T call() throws Exception {
           T result = null;     
          stmt.executeUpdate();
           rs = (ResultSet) stmt.getObject(outParameter);
           rs = this.wrap(rs);
           result = rsh.handle(rs);  
        return result;

  • Idoc to Jdbc using stored procedure

    Greetings All,
      In my scenario i want to send the idoc from SAP system to SQL database using the stored procedure. I want ack back from JDBC adapter when the record is sucessfully inserted in DB table. There after i can update the status of idoc sent in source SAP system. Can anyone suggest me how to achive this since its seems to like a syncronous scenario. Can we achive this without stored procedure i.e. calling Insert_Update statement
    Many thanks,
    Sandip

    Hi,
    Go through this thread
    Re: XI IDoc Acknowledgement - Acknowledgement not possible status
    Regards
    Laxmi Bhushan

Maybe you are looking for

  • How to add a group of rows in internal table

    Hi champs,    I have some requirement. I have one internal table which contain 4 columns .out of which 3 has some numeric value and first has some letters e.g A ,B,C etc. Now suppose i have 20 rows in itab in which 10 are A 5 are B and 5 are C .Now a

  • India: how to handle material with excise inventorised?

    Dear all, following setup was planned for purchasing trading goods locally to depot: 1) Flag material as non cenvatable in J1ID and remove the Cenvat determination for the same 2) Create PO with this material using tax code deductable, no excise gets

  • Grouping of Cleared Items

    Hi All, My user wants me to club all the cleared items togather, for example, suppose we have 10 open items in vendor account nowwhen i make the payment through F110 i'm generating one cheque only with one clearing document for all 10 open items but

  • TC - External HDD or not?

    I just picked up my Time Capsule and backed up my Macbook on it today. I bought it under the pretense that it functions as an external hard drive, however I'm having difficulties managing it like you would any other hard drive. - I made a new folder

  • Time Machine seems to be deleting backups unnecessarily

    Data (used / total) volumes are as follows: Macintosh HD: 80 / 250GB (of the 80GB, 23GB is configured to be ignored by TM) USB drive 1: 463 / 640GB USB drive 2: Time Machine (see below) / 640GB All drives are encrypted with FileVault 2.  Some days ag