JDBC Sender - Oracle Stored procedures

hi all
i am working on JDBC sender - File receiver
I am fetching data from Oracle database
if i write select query directly in sender adapter the scenario is working properly but when try to write stored procedure in oracle and use execute statement in JDBC, adapter is throwing error.
As in oracle to fetch multiple rows i have to use cursors .
i read lot of articles in forum but still not clear on following issues :can any one solve them?
1 . To get multiple rows can i write SP without cursors?
2 . If SP is using cursor do my XI accept it or it only accepts  resultset? in that     case how to write sp.
thanks & regards
sheetal

Sheetal,
Adding to Jai Shankar's reply, Like pointed out, Oracle Stored Procedures return Cursors and XI sender JDBC adapter expects resultsets and so it is not possible to call Oracle SP's from Sender JDBC adapters.
But, I have also come across a few recent threads where there have been discussions that this is possible  from SP 16 onwards. I have not been able to check and confirm on this, but, maybe you can check your SP level and see if you are below SP 16 . If yes, definetly not possible. If SP 16, or above, a Quick OSS to SAP should surely give the answer if it is possible or not!
Do let us know your findings.
Regards
Bhavesh

Similar Messages

  • JDBC Sender With Stored Procedure & Context Handeling

    Hi All,
    In my scenario i am using stored Procedure in JDBC sender adapter for Fetching data,
    I am fetching data from 3 tables kepping a one key element Exampkle  <matnr> for each value in this <matnt> in table 1 i will fetch the corresponding records in table 2 and 3 ...
    how can i use context in mapping such a sender structure to hendle the emplty value ...give me some idea...
    if any one has come across such situation plz help me ....it very urgent .
    thanks
    Shakif

    Hi,
    Follow this
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    JDBC adapter
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    stored procedure
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    Helpful link
    http://help.sap.com/saphelp_nw04/helpdata/en/45/023c41325fa831e10000000a1550b0/frameset.htm
    Might help you..
    vasanth.

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

  • Scripted JDBC and Oracle Stored Procedure with in/out Array

    The com.waveset.util.pooledconnection used by Scripted JDBC Adapter extends java.sql.connection.
    I need to pass an Varchar2 Array to the Stored Procedure. I tried using the oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to pass the values, but get a casting exception,as the polledconnection implements only the java.sql.connection and not oracle.sql.connection.
    What are my options of using java.sql.Array with a PL/SQL procedure that takes a varchar2 array as in out parameter?
    Thanks
    Venki

    i ran my procedure which is very similar syndra posted
    create or replace procedure foo(p_dt in date, cv out sys_refcursor) as
    begin
    open cv for
    select e.*
    from table_xyz e
    where start_dt = p_dt;
    end;
    /Here is how is executed
    DECLARE
      P_DT DATE;
      CV SYS_REFCURSOR;
    BEGIN
      P_DT := '10-oct-2005';
      -- CV := NULL;  Modify the code to initialize this parameter
      scott.foo ( P_DT, CV );
      COMMIT;
    END;           
    -- i get PL/SQL procedure successfully complted , But i dont see the result set Or output
    - How do i see the output when i m using refcursor ?? i tried using print , but nothing didnt work
    - Any idea ??
    Thank you!!
    Edited by: user642297 on Jun 24, 2010 1:35 PM

  • JDBC Sender MSSQL Stored Procedure - Multiple Select Statements

    Hello all,
    I will proceed to tell you my problem, for which solution I request your kind advice:
    Im working in a project for a retailer, which consists in sending the information from erp and sql server to pos thru XI interfaces.
    One of the interfaces is about sending items from sql server to a file so the pos can load it into the system. For doing so I have devloped an stored procedure which function is to return several select statements as many stores the retailer might have, so they can have a different file per store along with its corresponding items in it. 
    The thing is that XI just gets the first select statement and creates the corresponding file, but it seems to ignore the remaining responses as I'm neither getting any file nor an error afterwards.
    So, my question is: is XI capable of handling multiple select responses from an Stored Procedure in graphical mapping??? Or am I just wasting my time trying?
    Thanks in advice for your help.
    Regards.

    Hello Ramkumar,
    After 5 days trying, I finally made it work out applying your advice. Below the short explanation of what I did:
    My Source structure is: Main Node->Row->Records (Material Number, StoreNum, Price, Status)
    My Target structure is: Main Node->File Node->Record Node->Records ( Material Number, Price, Status)
    The key was to make all the occurrences happen against StoreNum node. So, based on what you adviced these two where the key mappings:
    1) The Mapping that will create a new file for each different store that comes in the query (In my case, query was already sort by store using an sql "order by" function, if not you can also use xi node function "sort" as Ramkumar suggested)
    StoreNum->RemoveContext->SplitbyValue (Value Changed)->Collapse Contexts->File Node
    2) The Mapping that will create each record in its corresponding store file:
    StoreNum->RemoveContext->SplitbyValue (Value Changed)->Record Node
    And Voilá !!! It worked.
    Thanks very much Ramkumar.
    Regards.

  • Passing XMLType Data into oracle stored procedure using JDBC

    Hi Friends,
    I have requirement where my oracle stored procedure accepts XML file as an input. This XML File is generated in runtime using java, I need to pass that xml file using JDBC to oracle stored procedure. Please let me know the fesibile solution for this problem.
    Following are the environment details
    JDK Version: 1.6
    Oracle: 10g
    Server: Tomcat 6.x
    Thanks in Advance

    user4898687 wrote:
    I have requirement where my oracle stored procedure accepts XML file as an input. This XML File is generated in runtime using java, I need to pass that xml file using JDBC to oracle stored procedure. Please let me know the fesibile solution for this problem.As stated - no.
    A 'file' is a file system entity. There is no way to pass a 'file' anywhere. Not PL/SQL. Not java.
    Now you can pass a file path (a string) in java and to PL/SQL.
    Or you can pass xml data (a string) in java and to PL/SQL. For PL/SQL you could use eithe a varchar2, if the xml is rather small, or a blob/clob.

  • 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

  • JDBC Sender adapter - Oracle - Stored Procedure - Error

    Hello,
    Need few clarifications on JDBC sender adapter and stored procedures when connecting to Oracle DB.
    My scenario is, Oracle to SAPBW. So in sender JDBC adapter, we have used a SP having multiple SQL statements it, esp. one of the SELECT statment having Joins on a table and View.
    My questions are,
    1) Is it possible to have more SQL statements in SP for Sender JDBC?
    2) Is the SP of Oracle DB returns resultset or cursor?
    I have tried in searching the forum perticularly for connecting to Oracle as Sender and below like said  that there is a limitation of XI JDBC when connecting to Oracle.
    Executing an Oracle Stored Procedure from Sender JDBC adapter
    So please clarify the doubts and help me.
    With regards,
    Jilan

    Hi Jilan,
    Unlike what was mentioned in the link given by you that oracle returns cursor and not resultset is not completely true. It may be difficult but certainly not impossible.
    Refer : http://www.enterprisedt.com/publications/oracle/result_set.html
    regards
    joel

  • Invoking Oracle stored procedures from within a JDBC channel for PI 7.1

    Hi ,
    Can anybody tell me that is it possible to invoke Oracle stored Procedure from within a JDBC  sender channel for PI 7.1.
    Its working in XI3.0 and XI 7.0 for Oracle DBMS versions >= 10.2.x. But I am not sure,whether it will work for PI 7.1 also.
    Thanks & Regards,
    Saru

    HI,
    refer below link,there is no much difference in PI7.1 ,executing stored procedure is same .
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm
    Regards,
    Raj

  • Sender JDBC support the stored procedure in SQL Server 2005

    Dear All,
    My question here is , Sender is JDBC adpter support to call the Stored procedure in Microsoft SQL Server 2005?
    I followed the below thread before posting this question
    Sender JDBC Adapter Supports Stored Procedures????
    In the thread Suraj response has mentioned SAP note: 941317, I checked the note, Note says it supported only ORACLE DBMS versions.
    Could you please clarify about this to possibility to call the stored procedure in Microsoft SQL server 2005?
    Thank you in Advance
    Sateesh

    Hi Sateesh,
    To answer your query, Yes it does. SP call works with SQL Server 2005 as well, the SP call should be "execute SPNAME <paramas>". In the place of update statement put any junk value as mentioned in the earlier comment.
    But just one thing to be noted, the select or any other query returning the desired resultset must be the first statement in youre SP returning value to the calling app. Means if there are any update, deletion or intermediate select queries to be used with in your SP, those all should be placed after the Main Select query that returns the desired resultset. Variable declarions and assignments are allowed.
    But if the seq of statements in your SP are like:
    @var1 Varchar
    Update <tablename>....
    Select * from <tablename>
    Then the output of the SP is :
    1 row updated
    <the resultset from select>
    In such cases, PI can recognise the first value returned only, that is "1 row updated" and hence the returned resultset wouldn't be seen by PI or not be passed to integration engine. Hence the update should come after the main Select.
    One more interesting piece of information, even if you copy and paste the entire SP code in place of the query string of Sender JDBC adapter, that too will work with all your variable declarations, multiple queries and updates and everything. Just have to follow the above rule.
    Let us know what you find.
    Regards,
    Suddhasatta

  • JDBC Receiver to ORACLE Stored Procedure

    Hi Experts
    I browed the forum and could not find a strait answer to my problem. Hence I am posting this thread.
    I have a sync call using JDBC Receiver to ORACLE stored procedure.
    The definition of the procedure is as follows:
    CREATE OR REPLACE procedure TW.XI_TEST
        (p_edi_extract_id varchar2, p_res out edi_extract%rowtype) is
    t edi_extract%rowtype;
    begin
      select *
      into p_res
      from edi_extract e
      where e.edi_extract_id = to_number(p_edi_extract_id);
    exception
       when no_data_found then
            p_res := t;
    end XI_TEST;
    The request XML is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:MT_EDIExtractSelectionRequest xmlns:ns0="urn:zim.com:tests">
    <STATEMENT>
    <PROC_NAME ACTION="EXECUTE">
      <TABLE>TW.XI_TEST</TABLE>
      <EDI_EXTRACT_ID isInput="true" type="STRING">4223142</EDI_EXTRACT_ID>
      </PROC_NAME>
      </STATEMENT>
      </ns0:MT_EDIExtractSelectionRequest>
    The error I am getting is as follows:
    com.sap.engine.interfaces.messaging.api.exception.MessagingException:
    Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'TW.XI_TEST' (structure 'STATEMENT'):
    java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306:
    wrong number or types of arguments in call to 'XI_TEST' ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Any help would be appreciated.
    Regards
    Effi.

    >
    Rajesh wrote:
    > > Hi Rajesh
    > >
    > > The structure of my data type for the request query is as follows:
    > >
    > >
    DT_EDIExtractSelectionRequest (Complex Type)
    > >    STATEMENT (Element)
    > >       PROC_NAME (Element)
    > >          ACTION (Attribute) _mapped to_: EXECUTE
    > >          TABLE (Element) _mapped to_: TW.XI_TEST
    > >          EDI_EXTRACT_ID (Element) _mapped to_: 123456
    > >             isInput (Attribute) _mapped to_: true
    > >             type (Attribute) _mapped to_: STRING
    > >          EDI_EXTRACT (Element)
    > >             isOutput (Attribute) _mapped to_: true
    > >             type (Attribute) _mapped to_: CURSOR
    > >
    > >
    >
    >
    > Change the DT type to like below
    >
    >            STATEMENT (Element)
    >                   ACTION (Attribute) _mapped to_: EXECUTE
    >                   TABLE (Element) _mapped to_: TW.XI_TEST
    >                   EDI_EXTRACT_ID (Element) _mapped to_: 123456
    >                        isInput (Attribute) _mapped to_: true
    >                        type (Attribute) _mapped to_: STRING
    >                   EDI_ETRACT (Element)
    >                      isOutput (Attribute) _mapped to_: true
    >                     type (Attribute) _mapped to_: CURSOR

    > and try ...actually i dont remeber the exact strucuture..but i tolo faced the same pain of this
    >
    > HTH
    > Rajesh
    Hi Rajesh
    Changing the DT per your suggestion result in the following error:
    <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser:
    No 'action' attribute found in XML document
    (attribute "action" missing or wrong XML structure)</SAP:AdditionalText>
    Omitting the PROC_NAME element from the DT is not correct.
    Also, I would also like to clarify that the variables of the DT I am using are:
    EDI_EXTRACT_ID is defined as string
    EDI_EXTRACT is defined as string
    Because the variable p_res is mapped to nothing in the request payload it does not show.
    I read in one of the posts that this is correct and the variable is used due to the fact the isOutput attribute is true.
    Regards,
    Effi.
    Edited by: Effi Olivkovitch on Dec 6, 2009 9:11 AM
    Edited by: Effi Olivkovitch on Dec 6, 2009 9:18 AM

  • JDBC Thin-Driver and Oracle Stored Procedure

    I've got a Oracle stored procedure which returns a Oracle record.
    How can I retrieve the record in java using the JDBC Thin-Driver ?
    Record:
    TYPE messagerec IS RECORD
    (log_level VARCHAR(2), timestamp VARCHAR2(19), text VARCHAR2(200));

    Using PL/SQL BOOLEAN, RECORD Types, and TABLE Types:
    Oracle SQLJ and JDBC do not support calling arguments or return values of the
    PL/SQL BOOLEAN type or RECORD types. Also, when using the Thin driver, they
    do not support calling arguments or return values of PL/SQL TABLE types (known
    as indexed-by tables). TABLE types are supported for the OCI driver.
    Check the following guide,
    http://otn.oracle.com/tech/java/sqlj_jdbc/pdf/a96655.pdf

  • Sending '?' in XML tag to Oracle Stored Procedure

    I have a situation that I cannot find the answer to why it is happening.
    I am sending an XML data type to an oracle stored procedure. In one of the fields, I need to allow the '?' character to be sent.
    <ADDITIONALINFO>This is where I want ? to be</ADDITIONALINFO>
    When I send the info to the stored procedure I get the following error: ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing
    LPX-00216: invalid character 191 (0xBF)Error at line 19
    What I do not understand is that the character (0xBF) is the inverted question mark �
    I have been able to get around the issue by changing the question mark to &#63; which is the decimal format for the question mark and the query works.
    ie: <ADDITIONALINFO>This is where I want &#63 to be</ADDITIONALINFO>
    Is there another delimiter that is needed for '?' like what is needed to print the & in & fashion?
    Any insight to this issue would be helpful.

    There are some characters that you cannot use in an XML document, but I was not aware that the questionmark was one of them. As far as I know, you need to transform the characters '&', '<' and '>', and any character with a code higher than 127. The fact that the question mark is turned into an upside down questionmark seems to be some weird functionality.

  • How send mail from Oracle stored procedure?

    Hi,
    I need send mail using Oracle stored procedure. Can anybody helpme with any recomendation about that, sample code or so?.
    [email protected]
    null

    Hi Raul Martinez
    utl_smtp package is available since oracle 8.1.6.
    If U have a older version then U can not.
    Thank U.
    edwin

  • Help Required on Cross Referencing with Oracle Stored Procedure

    Hi Experts,
       I have a requirement which is having the requirements as follow,
    Web Application initially sends a request number to SAP ECC to fetch the response details through SAP PI (HTTP to RFC u2013 Synchronous). While fetching the response from SAP ECC system, SAP PI has to invoke a Oracle Stored Procedure based on some parameter from SAP ECC System and then composited data has to send back to Web Application by SAP PI.
    Request you to kindly suggest how to achieve the above.  JDBC lookup is not much extended to call stored procedure. It would be helpful if it will be a step by step as I am novice to SAP PI.
    Regards
    Archana

    you might very well have to use a BPM.
    open a sync/async bridge ->
    do a sync call to RFC ->
    Do a sync call to DB (use SP here) ->
    do a transformation from the response message of RFC and Response of DB (N:1) to for your response to original caller (http)
    Close the sync async bridge using the response message

Maybe you are looking for

  • SSO ticket wont work for displaying contents of internally stored files

    Thx to the help I got here the application here is all in all running well with SSO as authentification method. But the application has a part where it tries to open & display files stored in the backend (e.g. Excel-Sheets, TIFs etc). This part was r

  • Instrument assistant

    Hi I'm trying to run Instrument Assistant in LabView 8.2 and whenever I put it on the block diagram I get the error "Measurement & Automation Explorer or the Instrument I/O Assistant is not installed correctly. Please install these from the LabView D

  • I need to trim out the second word of a string

    If the string is as follows I need to always return the second word: This is an example. (I need to return 'is') Another example string. (I need to return 'example')

  • Brush with two lines showing feather border

    Is there a way to set brush cursor to look like camera raw one or lightroom one, where You are able to see two lines( one showing feather border and second showing main brush area) Is there a way to position picture on screen to not be displayed in m

  • Original folder is missing...

    I clicked on an important folder when I received (paraphrasing) "Original folder is missing...." and something about an Alias. I didn't create an Alias for the folder. A window popped up saying to select an application to open the alias; Apple Script