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

Similar Messages

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

  • 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

  • Variables or parameters in Sender JDBC Adapter.

    Hi,
    I have the following question:
    Is there any way to use variables or parameters when specifying the WHERE clause of a SQL SELECT statement or when using a Store Procedure in a Sender JDBC Adapter? If so, can anyone give an example.
    Thanks in advance.
    Sebastian Pereira.

    Hi Sebastian,
                   The links mentioned below will help you in this regard:
    Using a stored procedure for a  sender jdbc adapter
    Stored Procedure in sender JDBC
    JDBC Sender - Oracle Stored procedures
    Reward with points if helpful
    Regards
    Sai Ganesh

  • Error while executing the stored procedure through sender JDBC adapter

    Hi All,
    I am getting below error while executing the stored procedure through sender JDBC adapter.
    Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    what is the problem? any idea to anyone...
    regards
    Ramesh

    hi Dharamveer,
    I am not getting below statement for your reply
    Try to use Refrence Cursor it will return u reference of resultset.
    I mention SP like this
    exec SapgetNextEntity 'SalesOrder'
    SapgetNextEntity -
    > SP Name
    SalesOrder----
    > Parameter I am passing...
    regards
    Ramesh

  • Stored procedure in Sender JDBC Adapter

    Hi All,
    My Scenrio goes like this ...
    Stored Procedure(SQL Server) --- PI  -
    File
    I need to write the results of  stored procedure to File.Here I don't need any mapping.So how many DT , MT and MI need to be created?
    The interface need to run by 6AM from Monday to Thrusday, how can i achieve this ?
    Stored Procedure has only select statement and no Update statement , but it takes Date as Input parameter , so what i need to provide in sender JDBC adapter.
    Thanks,
    Monish

    Hi Monish,
    As per your requirement it is JDBC to File. Please be careful with the structure to be created for sender JDBC. I am unable to understand why you donot require a mapping for this. How XI will send the data to a file then.As per my knowledge if it's file to file and just pick and drop then we can neglect IR and go for ID.But here you are working with JDBC and File so you will be in need of it.
    IR:
    DT: 2
    JDBC_Sender_DT
    File_Output_DT(Optional)
    You can use the JDBC sender data type structure for File output also.
    MT as per your DT
    MI:2
    Outbound MI: JDBC structure
    Inbound MI : File structure
    MM: 1
    IM: 1
    ID as similar to other scenarios.All 1 objects for RD,ID,Sender Agreement and Receiver Agreement.
    Sender JDBC channel:
    Query: Select * from table where date
    But I have a query how are you providing date in input paramerter.It will be dynamically entered into the query right.
    You can mention the Avalibility planning for your interface to work in RWB.
    Go to RWB>Component Monitoring>Adapter Engine->Communication Channel Monitoring>Avaliablity Planning
    Please explain.
    Regards,
    Nutan

  • Stored procedure : how to call SP in sender JDBC adapter for mysql

    HI friends ,
    we have JDBC---->XI--
    >SAP  scenario. For some business requirement, we have to call STORED PROCEDURE , please let me know how to call  SP in sender JDBC adapter for mysql .
    Thanks
    mojib

    Hi Mojib,
    Please create a sample stored procedure like this which contains select statement and in communication channel give
    wite stored procedure name only to sql query statment and in update statement write <test>.
    I am executing this stored procedure successfully.
    Create Proc GetResultX As
    Begin
    Select * From TESTX
    End
    Execute statement for stored procedure is :
    Exec GetResultX
    Regards
    Laxmi Bhushan Jha
    Rewards point if found usful
    I have given same answer to one of the same  thread

  • Error in calling stored procedure in sender JDBC adapter

    Hi Experts,
    I am working on MySQl to SAP scenario. I have to use stored procedure in sender JDBC adapter.
    I am calling SP as fallows: execute proc_dtdc_booking_interface_sd
    But it returned following error,
    Database-level error reported by JDBC driver while executing statement 'execute proc_dtdc_booking_interface_sd'. The JDBC driver returned the following error message: 'java.sql.SQLException: Unknown prepared statement handler (proc_dtdc_booking_interface_sd) given to EXECUTE'. For details, contact your database server vendor.
    the way i called SP is correct ??
    please suggest me how to resolve the issue ??
    Regards,
    Bhuvan.

    Hi
    Below is the code , when we are using this code directly in the mySQl command promp, it fetches 10 record but when the same code is called through XI adapter  its fetching only one record
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `proc_dtdc_booking_interface_sd` $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_dtdc_booking_interface_sd`()
    BEGIN
    declare done int(1);
    declare v_dsr_booked_by char(1) ;
    declare v_dsr_branch_code char(3) ;
    declare v_dsr_cust_code varchar(7) ;
    declare v_dsr_booking_date date ;
    declare v_dsr_cnno char(9) ;
    declare v_dsr_cn_type char(3) ;
    declare v_dsr_cn_weight decimal(8,3) ;
    declare v_dsr_dest char(3) ;
    declare v_dsr_mode char(2) ;
    declare v_dsr_amt decimal(10,2) ;
    declare v_dsr_dox char(1) ;
    declare v_office_code char(3) ;
    declare v_dsr_status char(1) ;
    declare v_dsr_remarks varchar(25) ;
    declare v_dsr_refno varchar(20) ;
    declare v_dsr_transmf_no varchar(10) ;
    declare v_dsr_trans_status_xi char(1) ;
    declare v_ndsr_cnno char(9) ;
    declare v_ndsr_product char(3) ;
    declare v_ndsr_sercharge decimal(8,3) ;
    declare v_ndsr_ins_amt decimal(8,3) ;
    declare v_ndsr_others decimal(8,3) ;
    declare v_dr_amt_type decimal(2,0) ;
    declare v_dr_extra_amt decimal(10,2) ;
    declare v_sales_document varchar(2) ;
    declare bookcur CURSOR for
    SELECT *
    FROM dtdcdb_rw.dtdc_booking_interface_sd
    LIMIT 10;
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE=1;
    set done=0;
    OPEN bookcur;
    bookloop: loop
    FETCH bookcur
    INTO
    v_dsr_booked_by ,
    v_dsr_branch_code,
    v_dsr_cust_code,
    v_dsr_booking_date,
    v_dsr_cnno,
    v_dsr_cn_type,
    v_dsr_cn_weight,
    v_dsr_dest,
    v_dsr_mode,
    v_dsr_amt,
    v_dsr_dox,
    v_office_code,
    v_dsr_status,
    v_dsr_remarks,
    v_dsr_refno,
    v_dsr_transmf_no,
    v_dsr_trans_status_xi,
    v_ndsr_cnno,
    v_ndsr_product,
    v_ndsr_sercharge,
    v_ndsr_ins_amt,
    v_ndsr_others,
    v_dr_amt_type,
    v_dr_extra_amt,
    v_sales_document ;
    IF DONE=1 THEN
    LEAVE bookloop;
    END IF;
    select
    v_dsr_booked_by As dsr_booked_by,
    v_dsr_branch_code As dsr_branch_code,
    v_dsr_cust_code As dsr_cust_code,
    v_dsr_booking_date As dsr_booking_date,
    v_dsr_cnno As dsr_cnno,
    v_dsr_cn_type As dsr_cn_type,
    v_dsr_cn_weight As dsr_cn_weight,
    v_dsr_dest As dsr_dest,
    v_dsr_mode As dsr_mode,
    v_dsr_amt As dsr_amt,
    v_dsr_dox As dsr_dox,
    v_office_code As office_code,
    v_dsr_status As dsr_status,
    v_dsr_remarks As dsr_remarks,
    v_dsr_refno As dsr_refno,
    v_dsr_transmf_no As dsr_transmf_no,
    v_dsr_trans_status_xi As dsr_trans_status_xi,
    v_ndsr_cnno As ndsr_cnno,
    v_ndsr_product As ndsr_product,
    v_ndsr_sercharge As ndsr_sercharge,
    v_ndsr_ins_amt As ndsr_ins_amt,
    v_ndsr_others As ndsr_others,
    v_dr_amt_type As dr_amt_type,
    v_dr_extra_amt As dr_extra_amt,
    v_sales_document As sales_document;
    update dtdcdb_rw.dsr_table
    set dsr_trans_status_xi='T'
    where dsr_cnno=v_dsr_cnno;
    end loop;
    SELECT *
    FROM dtdcdb_rw.dtdc_booking_interface_sd
    LIMIT 10;
    END $$
    DELIMITER ;
    Please help
    Regards
    Bhuvan

  • How to use Stored Procedure Call in Sender JDBC adapter

    Hi All,
             Could someone send me a blog on how to use Stored Procedure call in Sender JDBC adapter?
    Xier

    Hi Xler
    refer these links
    /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Also, you can check Sriram's blog for executing Stored Procedures,
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    This blog might be helpfull on stored procedures for JDBC
    JDBC Stored Procedures
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Please go through these threads and see if it helps...
    Re: How to execute Stored Procedure?
    Re: Problem with JDBC stored procedure
    Thnaks !!

  • Sender JDBC Adapter Supports Stored Procedures????

    Dear All,
    I was trying to use the Sender JDBC adapter to call the Stored procedure in the Sender JDBC adapter is possible to do this???
    I don't think Sender JDBC Adapter is supported to execute the Oracle Started Procedures. With my understanding only the Receiver JDBC Adapter will supported for the Stored Procedures using the message mapping Action = EXECUTE and Table = DBO.EmployeeMasterTable.
    Please let me know how to achieve the below scenario.
    My Scenario JDBC to RFC
    Query SQL Statement:
    select * from dbo.emp where flag = 'Insert' or flag = 'Update' or flag = 'Delete'
    Update SQL Statement:
    UPDATE dbo.emp SET flag = null WHERE flag IN ('Insert', 'Update');
    DELETE dbo.emp WHERE flag = 'Delete';
    In the my update statement I need to update few data flag with Insert , Update and need to delete the of the old records as mentioned above the query.
    In the response mapping I am using the Action = INSERT and Table = emp.
    Thanks,
    Jane F.

    Hi Jane,
    >>My requirment is to select from the DB and update and delete needs to be done. How I need to call this stored procedure in Sender JDBC adapter.
    An example of SP call is mentioned in the previous note Note 941317 - XI / PI JDBC Adapter: Known Problems / Incompatibilities
    SP Code
              ---------- pkg1 ----------
    CREATE PACKAGE pkg1 AS
      TYPE numset_t IS TABLE OF NUMBER;
      FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED;
    END pkg1;
    CREATE PACKAGE BODY pkg1 AS
    -- FUNCTION f1 returns a collection of elements (1,2,3,... x)
    FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED IS
      BEGIN
        FOR i IN 1..x LOOP
          PIPE ROW(i);
        END LOOP;
        RETURN;
      END;
    END pkg1;
    In sender channel mention
    >> SELECT * FROM TABLE(pkg1.f1(5));
    >>Is this need to be in the one stored procedure right. Can ou let me know how it should be handled in JDBC Adapter.
    Yes it shoudl be a single SP. Mention a select statement as given in above example.
    What is your Oracle version?
    Regards
    Suraj

  • Sender JDBC adapter : Update SQL Statement : stored procedure

    Hi,
    Can we use a stored procedure in the sender jdbc adapter in 'Update SQL Statement'.
    The problem i am facing is like, we are selecting data from two tables in 'SQL statement for query' and then in 'Update SQL Statement' , we need to delete that data from these two tables.
    Please let me know if it is possible.
    Thanks,
    Rohit

    you can use a Stored procedure in the
    Query SQL Statement
    You have the following options:
    ·        Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
    ·        Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
    so have your whole select and update as part of this single Stored procedure

  • Executing an Oracle Stored Procedure from Sender JDBC adapter

    I could really use some help from someone who had done this before. 
    I've read the help about using the JDBC sender adapter, but it's not helping enough.
    I found this line: "Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs."
    That's definately what we want to do, but we can't figure out the syntax.
    The procedure in oracle looks like this:
    CREATE OR REPLACE PROCEDURE test_ref_cursor
    ( cur_generic IN OUT result_sets.cur_generic)
    as
    BEGIN
    Open cur_generic for
    select
       proposal_number,
       to_char(sequence_number),
       column_name,
       column_value,
       update_timestamp,
       update_user
       from
       coeus.sap_test;
    END test_ref_cursor;
    And we have tried every kind of statement we can think of, but the file adapter always gives us an "invalid sql statement" error.
    Does anyone know what syntax we need to put in the "Query SQL Statement" in the JDBC sender adapter in order to call this procedure?  Or is there something wrong with the procedure that is causing the error?
    <i>I will absolutely return and give points, but PLEASE read my whole post before answering and do not just link me to or quote the help for configuring a sender JDBC adapter or blogs that are about the JDBC adapter in general but do not deal with the issues I am having. Thank you.</i>

    Hi Vanda,
    Unfortunately, the sender JDBC adapter does not support Oracle's store procedure/function.  Unlike stored procedures from other database vendors, Oracle returns a cursor, not a resultset.  The sender JDBC adapter must send a resultset to XI.
    There are 2 possible ways you can accomplish this:
    1.  Use BPM and call the Oracle stored procedure using a receiver adapter via a asynch-synch bridge.
    2.  Develop a user-module for the adapter, which can be used with a sender adapter.
    Thanks
    Prasad

Maybe you are looking for