XI/PI: jdbc receiver using stored procedure with arrays

The company needs an interface to search for header data and detail to a legacy system.
This interface from ERP  to legacy system is synchronous and uses stored procedure.
The definition of the stored procedure is as follows:
PROCEDURE
Generar_Detalle_Vtas_Pagadas
    (p_cvendedor                 IN bdc_vendedores.cvendedor%TYPE,
    p_fdesde                   IN DATE,
    p_fhasta                     IN DATE,
    v_encabezado_ct           OUT encabezado_ct,
    v_detalle_vtas_pagadas_ct OUT detalle_vtas_pagadas_ct,
    err_num                 OUT NUMBER
Data types used in stored procedure:
TYPE encabezado_ct AS OBJECT
( CREGION         NUMBER(22),
  XREGION         VARCHAR2(50),
  CMERCADO        NUMBER(22),
  XMERCADO        VARCHAR2(50),
  CTVENDEDOR      VARCHAR2(5),
  XCTVENDEDOR     VARCHAR2(50),
  XDENOMINACION   VARCHAR2(15))
TYPE detalle_vtas_pagadas_ct AS OBJECT
(     CITEM           VARCHAR2(10),
      XIDENTIFICADOR  VARCHAR2(15),
      XCONTRATO       VARCHAR2(15),
      XVALOR          VARCHAR2(30),
      CCUENTA         VARCHAR2(15),
      FACTIVACION     DATE,
      XDOMINIO        VARCHAR2(30),
      CCED            VARCHAR2(20),
      XCLIENTE        VARCHAR2(161),
      CCPO            VARCHAR2(60) )
As shown, this has three input parameters varchar and date respectively and has three output parameters, two of which are defined with a data
type such as table and the other number.
The problem is to define the signature of the stored procedure in XI when defining the data type request, the message type and mapping system
legacy because the data type is not supported (tables: detalle_vtas_pagadas_ct,encabezado_ct  )

FORM 2:
defined as an array, but the error tells me that we need to define the attribute either input or output
<?xml version="1.0" encoding="UTF-8"?>
     <ns0:MT_VtasPagadas_VYC xmlns:ns0="urn:VentasPagadas:VE_ALTASDEDCALIDAD_SD_VYC">
      <VtasPagadasRequest><Generar_Detalle_Vtas_Pagadas action="EXECUTE">
         <table>vyc.Vyc_Pack_Reportes_Sap.Generar_Detalle_Vtas_Pagadas</table>
         <p_cvendedor type="VARCHAR"></p_cvendedor>
         <p_fdesde type="DATE"></p_fdesde>
         <p_fhasta type="DATE"></p_fhasta>
         <v_encabezado_ct>
             <CREGION isOutput="1" type="NUMERIC">X</CREGION>
             <XREGION isOutput="1" type="VARCHAR">X</XREGION>
             <CMERCADO isOutput="1" type="NUMERIC">X</CMERCADO>
             <XMERCADO isOutput="1" type="VARCHAR">X</XMERCADO>
             <CTVENDEDOR isOutput="1" type="VARCHAR">X</CTVENDEDOR>
             <XCTVENDEDOR isOutput="1" type="VARCHAR">X</XCTVENDEDOR>
             <XDENOMINACION isOutput="1" type="VARCHAR">X</XDENOMINACION>
        </v_encabezado_ct>
        <v_detalle_vtas_pagadas_ct>
             <CITEM isOutput="1" type="VARCHAR">X</CITEM>
             <XIDENTIFICADOR isOutput="1" type="VARCHAR">X</XIDENTIFICADOR>
             <XCONTRATO isOutput="1" type="VARCHAR">X</XCONTRATO>
             <XVALOR type="VARCHAR">X</XVALOR>
             <CCUENTA isOutput="1" type="VARCHAR">X</CCUENTA>
             <FACTIVACION isOutput="1" type="DATE">X</FACTIVACION>
             <ICTA isOutput="1" type="VARCHAR">X</ICTA>
             <CCED isOutput="1" type="VARCHAR">X</CCED>
             <XCLIENTE isOutput="1" type="VARCHAR">X</XCLIENTE>
             <CCPO isOutput="1" type="VARCHAR">X</CCPO>
        </v_detalle_vtas_pagadas_ct>
        <err_num isOutput="1" type="NUMERIC">X</err_num>
     </Generar_Detalle_Vtas_Pagadas>
  </VtasPagadasRequest></ns0:MT_VtasPagadas_VYC>
Edited by: ymonasterio on Mar 31, 2010 4:48 PM

Similar Messages

  • With JDBC, calling a stored procedure with ARRAY as out parameter

    Hi,
    I want to use the data type ARRAY as an out parameter in an Oracle stored procedure. I want to call the stored procedure from
    my java program using JDBC.
    The problem it's i use a 8.1.7 client to acces with oci to a 7.1.3 Database.
    With this configuration I can get back a Cursor but not an Array.
    Does it's possible ?
    Thanks for your help !
    Michakl

    Originally posted by JDBC Development Team:
    It's very similar to other datatype except that it uses OracleTypes.ARRAY typecode and the value is mapped to a oracle.sql.ARRAY instance. The code looks as follows --
    cstmt.registerOutParameter (idx, OracleTypes.ARRAY, "VARRAY_TYPE_NAME_HERE");
    cstmt.execute ();
    ARRAY array = (ARRAY) cstmt.getObject (idx);
    Thanks for your reply.
    I have to use:-
    OracleCallableStatement cs1 = (OracleCallableStatement )conn.prepareCall
    ( "{call proj_array(?)}" ) ;
    for retrieving a collection as an OUT parameter.
    This gives me the errors:-
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Array getArray(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Clob getClob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Ref getRef(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    How do I get rid of these errors?
    null

  • JDBC-Adapter-Receiver Calling Stored Procedure with Input-Typ Record

    Hallo,
    I´ m trying calling a stored-procedure with two input-parameter; one of typ record (oracle) and one of type tabel of records. Is this possible (I think there are only types like string, integer etc. possible)? When not is there another possibility to work with that type?
    Thanks in advance,
    Frank

    Hi Frank,
    I think stored procedures will not take Array of Records as a Input. If you want to make a loop funtionality etc then JDBC adapter will work accordingly. You need to just call the stored procedure from the JDBC adapter. It will work for the array of records(multiple occurences).
    Receiver JDBC Procedures.
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Alternative option is you can make use of Java Proxy and from there you can call stored procedure ..I think it is possible.. not tried.
    Hope this helps
    Regards,
    Moorthy

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

  • Using Stored Procedures with TopLink / JPA : Success explanation

    For those who have to use Stored Procedures in TopLink this is my success history :
    To call an Stored Procedure from the persistence, we have to use the direct JDBC connection because my TopLink version ( Essentials 10g ) ? to date ( 10g ) does not have support for Stored Procedures.
    Here is my code :
    <address>{color:#0000ff} EntityManagerFactory JPAemfactory = null;{color}</address>
    <address>{color:#0000ff} JPAemfactory = Persistence.createEntityManagerFactory ("MyPersistenceUnit"); // this is the name of the persistence unit wrote in the persistence.xml file{color}</address>
    <address>{color:#0000ff} EntityManagerr MyEntityManager = JPAemfactory.createEntityManager ();{color}</address>
    bq. <address>{color:#0000ff}// creation of the stored procedure calling string .... one question mark for every param, output included \\ String sql = "{call SP_GETLISTATARIFAS(?,?,?,?,?)}"; \\ // We get the JDBC connection \\ oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl entityManager = (oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl) MyEntityManager; \\ UnitOfWorkImpl uow = (UnitOfWorkImpl)entityManager.getUnitOfWork(); \\ // we create a request to the unitofwork because if dont the connection will not exist \\ uow.beginEarlyTransaction(); \\ Connection conexion = ((UnitOfWorkImpl)uow).getAccessor().getConnection(); \\ {color}{color:#0000ff} \\ try { \\ // Creation of the call and we will identify the params as they are in the stored procedure definitiondefinidos \\ CallableStatement call = conexion.prepareCall(sql); \\ {color}</address>
    bq. <address>{color:#0000ff} \\ // params INPUT with their values \\ call.setString("pIDMCUPO", "125"); \\ call.setString("pCODIGOHOT", "8023"); \\ call.setString("pCODCANAL", "WEB"); \\ call.setString("pCODSUBCANAL", "HOTEL"); \\ {color}</address><address>{color:#0000ff} \\ // params OUTPUT \\ call.registerOutParameter("rRESULTADO", java.sql.Types.VARCHAR); \\ {color}</address><address>{color:#0000ff} \\ // execution \\ call.execute(); \\ {color}</address><address>{color:#0000ff} \\ // getting the response \\ mcontratos_out = call.getString("rRESULTADO"); \\ {color}</address><address>{color:#0000ff} \\ // closing the proc \\ call.close(); \\ {color}</address><address>{color:#0000ff} \\ } catch (SQLException ex) { {color}</address><address>{color:#0000ff} // something you do if there is an error \\ {color}</address><address>{color:#0000ff} \\ } {color}</address>
    Hope this helps all the people that have searched a lot like me.......

    I have my entity manager setup in a singleton.
    I'm finding it's costly to generate the emf, but if I don't close the em (enitity manager) and emf (entity manager factory) my open cursor count climbs until I exceed the max number of open cursors on the database (11g RAC)
    I'm committing the connection, and uow, and closing the em at the end of each call.
    But until I close the emf, the open cursors aren't released.
    TransactionhistoryPkg tranPkg = new TransactionhistoryPkg(conn); //Class created over database package via JPublisher
    tranPkg.transactionhistoryInsSp(insertTrans.getCardId()); // executes db package
    tranPkg.closeConnection();
    conn.commit();
    uow.commit();
    uow.getAccessor().decrementCallCount();
    em.close();
    Am I missing something really obvious here??
    btw - I found this link helpful in troubleshooting the max cursors issue: https://support.bea.com/application_content/product_portlets/support_patterns/wls/InvestigatingORA-1000MaximumOpenCursorsExceededPattern.html

  • Using stored procedures with a timestamp parameter with Delphi  and ADO

    Dear Oracle experts,
    I have a problem concerning using a stored procedure with Delphi.
    I try to use a stored procedure which hast two input parameters ( a integer and a timestamp).
    The timestamp parameter is my problem since I would like to use the "to_timestamp"
    Oracle-function to create the timestamp parameter to be inserted into my procedure.
    If I insert the to_timestamp statement as a adodatetime I have to perform the conversion to the oracle timestamp in my application.
    If I want to use the to_timestamp statement I have to use the ftstring datatype but in that case I get an error because I use a string as input for my procedure were it awaits a timestamp.
    So the problem seems to be that the function call "to_timestamp" is not interpreted if it is transferred through my ADO component.
    Do you know how to use a procedure with Delphi (ADO) with a function as input parameter ?
    Best regards,
    Daniel Wetzler
    P.S. :
    This is the Delphi code to use my Procedure.
    FactsTempDS:=TADODataset.Create(nil);
    Sproc1 := TAdoStoredProc.Create(nil);
    Sproc1.Connection := TDBConnection(strlistConnectionstrings.objects[iConnectionIndex]).Connection;
    Sproc1.ProcedureName := 'ECSPACKAGE.PROCFINDINITIALSWITCHSTATE';
    Sproc1.Parameters.CreateParameter ('SwitchID',ftInteger,pdinput,0,0);
    //Sproc1.Parameters.CreateParameter ('StartTime',ftdatetime,pdinput,50,0);
    Sproc1.Parameters.CreateParameter ('StartTime',ftString,pdinput,50,0);
    Sproc1.Parameters.Findparam('SwitchID').value:=SwitchID;
    Sproc1.Parameters.FindParam('StartTime').Value:= 'to_timestamp(''2005/12/30 19:36:21'', ''YYYY/MM/DD HH:MI:SS'')';
    Sproc1.CursorType := ctKeyset;
    Sproc1.ExecuteOptions:=[];
    Sproc1.Open;
    Sproc1.Connection := nil;
    FactsTempDS.Recordset:= sproc1.Recordset;
    if FactsTempDS.RecordCount=0
    then raise Exception.Create('No line switch variable found for switch '+IntToStr(SwitchID)+' before starttime. Check BDE dump filter.')

    I have my entity manager setup in a singleton.
    I'm finding it's costly to generate the emf, but if I don't close the em (enitity manager) and emf (entity manager factory) my open cursor count climbs until I exceed the max number of open cursors on the database (11g RAC)
    I'm committing the connection, and uow, and closing the em at the end of each call.
    But until I close the emf, the open cursors aren't released.
    TransactionhistoryPkg tranPkg = new TransactionhistoryPkg(conn); //Class created over database package via JPublisher
    tranPkg.transactionhistoryInsSp(insertTrans.getCardId()); // executes db package
    tranPkg.closeConnection();
    conn.commit();
    uow.commit();
    uow.getAccessor().decrementCallCount();
    em.close();
    Am I missing something really obvious here??
    btw - I found this link helpful in troubleshooting the max cursors issue: https://support.bea.com/application_content/product_portlets/support_patterns/wls/InvestigatingORA-1000MaximumOpenCursorsExceededPattern.html

  • How to use stored procedure with many return results and variable with perl

    Hi everybody,
    i´m writtting now a Perl programm, wich use a oracle stored procedure with more than 1 result and 1 variable(I have to return 2 variable fpr each result). I don´t now how I can get it.I already search the web but I didn´t find.
    My example:
    PROCEDURE get_projects_and_sub_projects (
    v_project_id IN INTEGER,
    v_project_c_id OUT INTEGER,
    v_project_id_find OUT VARCHAR2
    IS
    BEGIN
    SELECT c_id, proj_id
    INTO
    v_project_c_id,
    v_project_id_find
    FROM t_projet
    WHERE t_projet .ksa_pro_art_kbz = 'KU'
    AND t_projet.proj_id LIKE v_project_id || '%';
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_project_c_id := NULL;
    v_project_id_find := NULL;
    WHEN OTHERS
    THEN
    kmessages.error (NULL,
    'get_projects_and_sub_projects',
    'Project-Name: ' || v_project_id,
    'Errornumber: '
    || SQLCODE
    || ' Error: '
    || SQLERRM,
    TRUE,
    TRUE
    raise_application_error (-20001,
    'Error '
    || SQLCODE
    || ' get_projects_and_sub_projects: '
    || SQLERRM,
    TRUE
    END get_projects_and_sub_projects;
    in Perl Program:
    sub get_projects_unterprojects_name($$){
    my ($db_handle, $proj_name_id) = @_; #$db_handle ist the DB Connection return value
    my $db_proj_c_id;
    my $db_proj_name;
    eval{ my $csr = $db_handle->prepare(q{
    BEGIN
    pro_doc_ber.get_projects_and_sub_projects(:proj_name_id, :db_proj_c_id, :db_proj_name);
    END;
    # parameter value
    $csr->bind_param(":proj_name_id", $proj_name_id);
    # return values
    $csr->bind_param_inout(":db_proj_c_id", \$db_proj_c_id, 11);
    $csr->bind_param_inout(":db_proj_name", \$db_proj_name, 20);
    $csr->execute(); };
    But this didn´t work. Could somebody give me some idea?
    Thank you
    Felx

    Some additional info would probably be helpful.
    What is your programming enviironment? Java?
    In any case I suspect that you will need to use the OCI to deal with specific Oracle types such as user defined object types -- thats not standard ANSI SQL.
    In Java I believe you need to use OPAQUE, there are some examples out there. I'm mostly a PL/SQL developer with some Java expereince so others here are more qualifed to answer your question more directly.

  • Please help - Can not use stored procedure with CTE and temp table in OLEDB source

    Hi,
       I am going to create a simple package. It has OLEDB source , a Derived transformation and a OLEDB Target database.
    Now, for the OLEDB Source, I have a stored procedure with CTE and there are many temp tables inside it. When I give like EXEC <Procedure name> then I am getting the error like ''The metadata  could not be determined because statement with CTE.......uses
    temp table. 
    Please help me how to resolve this ?

    you write to the temp tables that get created at the time the procedure runs I guess
    Instead do it a staged approach, run Execute SQL to populate them, then pull the data using the source.
    You must set retainsameconnection to TRUE to be able to use the temp tables
    Arthur My Blog

  • Using stored procedures with dabasae controls

    Hi. We have two questions.
    Answer 1:
    We are working with Sybase and we are trying to use stored procedures (SP) with databse controls but we don't know how to obtain SP's return. We can to use SP normally if that SP don't have any return. Next example works fine but "stored_procedure_name" actually returns an number (error code) and we need to obtain it:
    * @jc:sql statement="{call stored_procedure_name (?)}"
    Answer 2:
    Do you know how to call SP dinamically? This mean to call an sql statemente where stored_procedure_name and its parameters could be pased as paremeters. That looks as:
    * @jc:sql statement="{call {sql: spName} {sql: listOfParameters}}"
    Thak you very much for your comments.
    Regards.

    I have my entity manager setup in a singleton.
    I'm finding it's costly to generate the emf, but if I don't close the em (enitity manager) and emf (entity manager factory) my open cursor count climbs until I exceed the max number of open cursors on the database (11g RAC)
    I'm committing the connection, and uow, and closing the em at the end of each call.
    But until I close the emf, the open cursors aren't released.
    TransactionhistoryPkg tranPkg = new TransactionhistoryPkg(conn); //Class created over database package via JPublisher
    tranPkg.transactionhistoryInsSp(insertTrans.getCardId()); // executes db package
    tranPkg.closeConnection();
    conn.commit();
    uow.commit();
    uow.getAccessor().decrementCallCount();
    em.close();
    Am I missing something really obvious here??
    btw - I found this link helpful in troubleshooting the max cursors issue: https://support.bea.com/application_content/product_portlets/support_patterns/wls/InvestigatingORA-1000MaximumOpenCursorsExceededPattern.html

  • Using stored procedure with ExecuteXmlReader

    Just looking to find out if it's possible to use stored procedures when createing an OracleCommand object that calls ExecuteXmlQuery. I'm having a problem and all the samples I've found for using this only use command text (inline SQL). TIA.
    Edited by: user9529215 on Mar 27, 2009 7:48 AM

    Hi,
    I have similar problem. Have you already solved the issue?
    Thanks

  • 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

  • XI JDBC Adapter using stored procedures

    Hi
    I am using the JDBC adpapter to call a stored procedure on a SQL database.
    In the adapter configuration I am using 'com.microsoft.jdbc.sqlserver.SQLServerDriver' as the JDBC Driver parameter and 'jdbc:microsoft:sqlserver://LIBOEE01:1433;DatabaseName=DEV_OEE;SelectMethod=cursor;' as the connection string.
    My payload is as follows:
      <?xml version="1.0" encoding="UTF-8" ?>
      <root>
        <Statement>
        <PL101_SAPR3_SKU_OBJ action="EXECUTE">
         <p_verb isInput="true" type="varchar">CREATE</p_verb>
         <p_site_id isInput="true" type="varchar">GPK</p_site_id>
         <p_sap_line_id isInput="true" type="varchar">LN005</p_sap_line_id>
         <p_sku_id isInput="true" type="varchar">4014847</p_sku_id>
         <p_sku_desc isInput="true" type="varchar">Klipdrift Exp -  12x750ml</p_sku_desc>
         <p_bottles_in_sku isInput="true" type="float">12</p_bottles_in_sku>
         <p_bps_sap isInput="true" type="float">2.083</p_bps_sap>
         </PL101_SAPR3_SKU_OBJ>
        </Statement>
       </root>
    However, when I cal lthe interface I receive the follwoing error in the adapter:
    2007-07-18 11:25:03 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null
    2007-07-18 11:25:03 Error Exception caught by adapter framework: JDBC Adapter configuration not initialized: null
    2007-07-18 11:25:03 Error Delivery of the message to the application using connection failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null.
    Is this possibly casued by the driver being the incorrect version?
    Regards
    Michael

    Hi Kanth,
    Thanks for your response, but the blog by Siva Maranani is actually where I got my code from. Upon further research I think have found the problem as experienced in this blog --> Re: MS SQL Server jdbc Driver installation on XI . There are 2 jar files missing from our SQL JDBC driver --> msbase.jar and msutil.jar, I think once I have added these to the driver it might work. Strange that when you download the driver from microsoft's website that these 2 files are only available in the UNIX download though!
    Regards
    Michael

  • How to use Stored Procedures with SQLServer2005 and WAS 6.x

    Hi All
    I've got a problem, during the call to a StoredProcedure in SQLServer i've get the next message:
        Exception : com.microsoft.sqlserver.jdbc.SQLServerException: Fetch size cannot be negative
    The stored procedure is working correctly if I run my process out of WAS 6.x but if I get a connection from the pool the process don't work.
    Help please, thanks.

    Your procedure has a single OUT parameter ... and yet it appears you are trying to stuff something into it ... that is never going to work. Additionally everything else about your stored procedure would have gotten you a FAIL grade were you been in my beginning PL/SQL class.
    The syntax, a cursor loop, is obsolete and has been for more than 10 years.
    The formatting and use of case makes even the few lines written hard to read.
    And either no commit ever takes place or you are trying to do incremental commits in origseq: Both of which are bad practice.
    This code should use BULK COLLECT to collect all relevant records into an array and then pass the array to origseq ... no loops ... and end with a commit.
    Demo here: http://www.morganslibrary.org/reference/array_processing.html

  • 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 - Oracle Stored Procedure - Large Records - Performance

    Hi friends,
    In my File to JDBC scenario, I use Oracle SP. I designed my target structure as mentioned in help.sap.com. In this scenario, the Sender file sends large no. of records, we have to update those records in the Oracle table. As per this requirement, I did mapping. I tested one file with 4 records. In SXMB_MONI, mapping works fine. I have given below the target payload. The message is processed successfully. (Still I have not created SP in database I am unable to check for the updating of records in the table).
    My doubt is
    1) Whether the target payload is correct ?
    2) For each <STATMENT> tag, Will XI establish connectivity to JDBC and update the record ? If it is, in real time if we send large no. of records, ex: 50 thousand records, performance isssu will come or not?
    3) How to solve the problem as said in point 2. (LookUp procedure etc)
    Kindly reply friends. (If you  have faced this problem ... kindly reply how to solve this issue)
    Target Payload:
    <?xml version="1.0" encoding="utf-8"?>
    <ns1:PSABCL_Mumbai xmlns:eds="http://sdn.sap.com/sapxsl" xmlns:ns0="http://abc.xyz.com" xmlns:ns1="http://abc.xyz.com/ABCL/Finance">
    <STATEMENT>
    <SP_ABCL ACTION="EXECUTE">
    <IF_ROW_STAT>FOR_IMPORT</IF_ROW_STAT><CON_FST_NAME>John</CON_FST_NAME><CON_LAST_NAME>Test001915</CON_LAST_NAME><CON_MID_NAME>W</CON_MID_NAME>
    </SP_ABCL>
    </STATEMENT>
    <STATEMENT>
    <SP_ABCL ACTION="EXECUTE">
    <IF_ROW_STAT>FOR_IMPORT</IF_ROW_STAT><CON_FST_NAME>Josephine</CON_FST_NAME><CON_LAST_NAME>Walker</CON_LAST_NAME><CON_MID_NAME>Rose</CON_MID_NAME>
    </SP_ABCL>
    </STATEMENT>
    <STATEMENT>
    <SP_ABCL ACTION="EXECUTE">
    </SP_ABCL>
    </STATEMENT>
    <STATEMENT>
    <SP_ABCL ACTION="EXECUTE">
    </SP_ABCL>
    </STATEMENT>
    </ns1:PSABCL_Mumbai>
    Thanking You.
    Kind Regards,
    Jegathees P.

    Hi,
    The structure should be -
    <MsgType Name>
    <StatementName>
    <storedProcedureName action = "EXECUTE">
    <table>
    <List of Parameters isInput = "true" type = "STRING">
    Map the table node to the stored procedure name.
    Also,
    For each statement, XI would make a database call. For better performance, do not check the button in CC - Open a new connection to database for each message.
    Also another solution would be, collect all the data in the mapping to a comma or a pipe separated string in the mapping and have the statement node created only once. This way, though you have 5000 records, they all will be given to the SP in one DB call. you can also manage the mapping so that you will not send more the the X number of records to database in a single call. We are using an XML created in code in an UDF for this. The SP has to take care of stripping the comma or pipe separated values or the XML sent as a string input parameter.
    VJ

Maybe you are looking for

  • New MBP logic board and wireless internet does not work anymore

    hi there i had to change the logic board in my only 2 years old MBP15". i purchased a new one and put it in by myself (relatively easy task). i still use the same internal HD as this one still works fine, so all data are the same. however, the new lo

  • Having trouble importing videos from phone to mac. Please help?

    I was trying to transfer video from my iphone to my Mac and nothing is happening. When i try to quit iphoto i get the message "Photos are being imported to the photo library. Please wait to import to complete." Not sure what to do. Tried restarting t

  • Problem with BAPI (Flight) Tutorial

    Hi, Im new in developeing with Web Dynpro for Java. I did every steps of this tutorial (Adaptive RFC tutorial - with the BAP_Flight_Getlist) exactly: http://help.sap.com/saphelp_webas630/helpdata/DE/b2/326b09e58bcf499f73b5cc278808f4/content.htm But i

  • How to stop itunes store sign in prompt when opening music

    When opening music on i pod touch, the prompt box appears asking me to sign in to i-tunes every time.  This also happens when device is reactivated using passcode - but only if music is already open. How do I stop this prompt happening?

  • My Macbook Pro is possessed. Now what?

    My MBP retina trackpad does not accept any user input, but the cursor is randomly jumping around and screens are switching from desktop to dashboard to mission control randomly. The best way to describe the cursor and screen switches is it looks like