Store procedure call to fetch data in JDBC sender adapter

Hi guys,
I have to fetch data from a Oracle server through JDBC adpater.
the partner has in place some store procedure that have to be used with this purpose.
But al the time I try to call a store procedure I got error that variables are not binded.
I fill up the query sql statement field with following text
call <store procedure name> (v1 OUT VARCHAR2, v2 in varchar2)
Does anyone know the syntax to access such store procedure within jdbc adapter?
As far as I know the jdbc call the store procedure with Callable statement but the paremeters need to be linked to datatype,but here I do not see such possibility.

HI
A stored procedure is a subroutine available to applications accessing a relational database system. Stored procedures (sometimes called a sproc or SP) are actually stored in the database data dictionary.
Typical uses for stored procedures include data validation (integrated into the database) or access control mechanisms. Furthermore, stored procedures are used to consolidate and centralize logic that was originally implemented in applications. Large or complex processing that might require the execution of several SQL statements is moved into stored procedures and all applications call the procedures only.
Stored procedures are similar to user-defined functions (UDFs). The major difference is that UDFs can be used like any other expression within SQL statements, whereas stored procedures must be invoked using the CALL statement
Stored procedures can return result sets, i.e. the results of a SELECT statement. Such result sets can be processed using cursors by other stored procedures by associating a result set locator, or by applications. Stored procedures may also contain declared variables for processing data and cursors that allow it to loop through multiple rows in a table. The standard Structured Query Language provides IF, WHILE, LOOP, REPEAT, CASE statements, and more. Stored procedures can receive variables, return results or modify variables and return them, depending on how and where the variable is declared.
http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm
One of the usage is to prevent the query to directly write to the database
http://en.wikipedia.org/wiki/Stored_procedure
Check these:
http://help.sap.com/saphelp_nw04s/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
Integration with Databases made easy – Part 1.
JDBC Stored Procedures
http://help.sap.com/saphelp_nw04/helpdata/en/45/023c41325fa831e10000000a1550b0/frameset.htm
Calling stored procs in MaxDb using SAP Xi
cheers

Similar Messages

  • JDBC Sender Adapter - Restrict number of rows fetched, Oracle

    Hi,
    Is it possible to restrict the number of rows fetched by the JDBC Sender adapter at each run? What would the appropriate Select and Update statements be to make sure a limited number of rows are selected and flagged as processed?
    We are connecting to a Oracle RDBMS.
    //Johan

    hi,
    have a look at this info:
    about oracle and limiting number of rows
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Date/Time Format Stored Procedure Calls in ADVANCE MODE in JDBC ADAPTER

    Hi Experts,
    What is significance of Date/Time Format Stored Procedure Calls in ADVANCE MODE in JDBC ADAPTER.
    Thanks,
    ABDUR

    I guess this would be applicable for the folowing formats - DATE, TIME, TIMESTAMP.
    This is the correct link
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    Regards,
    Prateek

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • JDBC sender adapter - 3 calls in PO 7.4

    Hi Experts,
    I have a scenario to fetch database records from ORACLE database using SAP PO 7.4 - JDBC adapter
    There are 3 calls to make in order to fetch the data
    a) Call a procedure before the fetch
    b) fetch the record
    c) Call another procedure after the fetch
    How can we achieve this ?
    thx
    mike

    Hi All,
    I am opening this up for a follow up qs on this topic. Is it true that we can't directly invoke a stored procedure from PI 7.4 sender JDBC adapter for retrieving data from ORACLE DB and we have to rely on table functions.
    I was looking at some blogs on sender JDBC stored procedure calls for SAP PI 7.1/7.3/7.4
    Executing stored procedure from Sender adapter in SAP PI 7.1
    Oracle Table Functions and JDBC Sender Adapter
    And the note Michael was referring to 941317 - XI / PI JDBC Adapter: Known Problems / Incompatibilities  has the following piece of code for invoking a stored procedure from a package function returning collection of elements.
               ---------- 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;
    ---------- pkg1 ----------
               This function has to be invoked from the sender channel configuration (SELECT statement) as follows:
               SELECT * FROM TABLE(pkg1.f1(5));
    If I can't call stored procedure directly from PI sender JDBC adapter in 7.4,
    I have to ask the Oracle DB guy to write a stored procedure which wraps all 3 procedures into one and again wrap it up using the package functions as well if required. So, please let me know.
    thx
    mike

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • JDBC Sender Adapter -  NOT FETCHING RECORDS -PROCESSING STARTED

    Hello all,
    I have set up a JDBC sender adapter .With polling interval as 30 Seconds. Polling is done successfully
    but it does not fetch the records .
    Valid Data is present in the tables.In the Communication Channel Monitoring log shows :
    "Processing Started"
    after each poll interval.
    Adding to this , it was working fine  with the same parameters two days back.
    I have enabled the Driver Trace but didnot get any information from Trace.
    How to resolve this issue?Any help
    Regards
    Ganga Prasad

    Hello maheshwari,
    Valid Data is there & many records are there to be fetched.
    One more thing  Normally in the Communication Channel Monitoring
    for an JDBC adapter even if there are no records to fetch we get the Log information in detail that :
    Polling interval started.
    Processing finished successfully
    Processing started
    Polling interval started.
    Processing finished successfully
    Processing started
    But here in my case am getting only : (polling interval : is 60 Seconds)
            2/5/08 8:29:19 AM           Processing started
         2/5/08 8:28:19 AM           Processing started
         2/4/08 3:34:54 PM           Processing started
         2/4/08 3:33:54 PM           Processing started
    One more observation is that my poll interval is 60 seconds but now it is polling after every 120sec
           2/5/08 11:17:31 AM           Processing started
         2/5/08 11:15:31 AM           Processing started
         2/5/08 11:13:31 AM           Processing started
         2/5/08 11:11:31 AM           Processing started
    I have tried refreshing Cache but no change .
    Regards
    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

  • Data from 2 tables for jdbc sender adapter

    how to pickup data from 2 tables at a time when using a jdbc sender adapter?

    select <fields> from table1 where <condition>
    union
    select <fields> fromt table2 where <condition>
    also u can combine this with joins as pointed

  • JDBC Sender Adapter - NOT FETCHING RECORDS...

    Hello Experts,
    I know this was answered in a separate thread (JDBC Sender Adapter -  NOT FETCHING RECORDS -PROCESSING STARTED).
    However, my question is, Is there a way that we can be notified if a channel has stopped fetching records?
    or is there a reporting tool that can be used to check/monitor if a channel is not processing any messages?
    Thanks & Kregards,
    allar

    Hi Sreedhar,
    Thanks for your reply.
    These case is not being captured by our alert configuration because its not throwing any error.
    in the communication channel monitoring, we see only something like this..:
    3/16/09 8:25:19 PM Processing started
    3/16/09 8:34:20 PM Processing started
    3/16/09 8:33:55 PM Processing started
    3/16/09 8:32:54 PM Processing started
    but no error is being displayed nor sent.
    Also, there was a case that the channel just stopped fetching, even though everything is active.
    example log:
            3/12/09 8:32:54 PM Processing started
    We're looking for ways on how we can trap these scenarios as early as possible,  get us notified and   perform adapter-lock release when needed.
    Regards,
    allar

  • JDBC sender adapter provides incomplete data

    Hi,
    I have a JDBC sender adapter which reads data from a MySQL table, and passes it to a proxy which writes the data then in a SAP table.
    - Query SQL statement = SELECT Field1, Field2, Field3, Field4 FROM jdbctest WHERE Processed = 'N'
    - Update SQL statement = UPDATE jdbctest SET Processed='Y' WHERE Processed='N'
    I did a stress test with a program that writes data simultaneously to the MySQL table (up to 10000 records), and the JDBC sender adapter which checks the table every 15 seconds.
    At the end, my SAP table contained only 9965 records.
    This means that probably there have been records added between the Query and the Update statement (So they haven't been read, but their status is changed).
    Does anyone have a solution for this?
    Best regards,
    Nicolas De Corte

    Hello Dharamveer,
    I don't really understand your answer.
    My point is that the JDBC adapter only processed 9965 records out of 10000, but it updated all 10000.
    So now in my MySQL table there are 10000 records with status Processed, but only 9965 have been really processed. And I think this is because records have been added between the execution of query and the update statement.

  • How to notify in case SQL query(JDBC sender adapter) does not fetch records

    hi,
    How can we notify(by alerts or something) in case SQL query(JDBC sender adapter) does not fetch records? In channels logs it only says processing started & finished(no message is created for same).
    Thanks,
    Mayank

    Hi,
    1 ) What is exact audit log message ?
    2) Try fetching the count in SQL statement  if there are any valid records it will give the count.
        May for testing you can use <TEST> in update statement.
    3) Have you used taskTimeout parameter ?
    4) Are multiple channels polling on same table ?
    regards
    Ganga

  • JDBC Sender adapter - can VIEW be used in Query statement

    Hi,
    In JDBC Sender adapter, can we use a VIEW sql query in the "Query SQL Statement" placeholder?
    For eg:
    CREATE VIEW <view name> as SELECT * from <table name> WHERE <condition>
    instead of the usual:
    SELECT * from <table name> WHERE <condition>
    Thanks,
    Vishak

    Hi
    What exactly is your use of creating a view, if you are going to fetch data from different tables, then you can use the view through stored procedures.
    Hope this clears your doubts
    Thanks
    Saiyog

  • JDBC Sender adapter question

    Hi,
    Scenario: JDBC-XI-R/3
    I am trying to run the JDBC sender adapter every 3 minutes based on the poll interval to select rows from Oracle db.
    In the select and update statements when I use the rownum < '11' and flag condition (Y or N), then I see XI is picking up 10 rows in a two times and I see two parallel processes in SXMB_MONI.
    I want XI to run only pickup 10 rows for every 3 minutes and update only 10 rows in Oracle to "N" from "Y".
    When I take out the rownum condition from update I do not see this issue.
    <u>Update statement:</u>
    Update <TABLE> set status_flag = 'N' WHERE status_flag = 'Y' and rownum < '11'.
    Can some body point me in the right direction ?
    Thanks
    Steve

    Hi there,
    See if this works. Though I never came across such a scenario, I can think what to be done in this case.
    Create a staging table as same structure as from where our JDBC adapter is picking up the data currently.
    Whrite a tigger(after delete) on staging table to call a stored procedure.
    stored procedure will select the data from source table and insert them in to staging table (rownum<11) as well as update the flag column in source table.
    Now load the staging table initially from source table with only 10 rows (one time process). Configure your JDBC adapter on staging table. In update sqlquery field of JDBC adapter write delete statement for all the data from staging table to be purged, as there will not be more than 10 rows at any time and after each time the adapter supplied Delete statement will purge the data so you dont have to worry about selecting 10 rows or updating 10 rows from JDBC adapter. As every time the trigger after delete statement will fire and load only 10 rows from source marking those 10 rows as read_already status.
    NOTE: for Calling stored procedure from trigger follow your database SQL reference documentation.
    Thanks.
    -Nilkanth.

  • Challenging issue with JDBC sender adapter

    Hello Guys
    I have this requirement
    From Oracle Database I have to read to tables  one for the header and one for the detailes and map the result to one RFC.
    I have only  worked with one table at the time with the JDBC sender adapter but never with 2  tables
    My challenges are
    1 - How I can read the 2 tables at the same select statement , I suppose I have to use a join with 2 identical fields , so far so good ,but how I can handle multiple records
    suppose the result is 10 new different records which each of the recored has to be mapped to the RFC , then we will have 10 RFC calls.
    how can I do the mapping in this case.
    2 - How can I update the 2 tables at the samme time and flag them as processed , as far as I know we can not use 2 update statement in the same JDBC sender
    any help will do
    Thanks in advance.

    Hi
    Thanks for the replayes
    The RFC is used to create and Invoice Idoc , It has to be one record (Header and Item ) to one RFC.
    a JDBC to IDoc can also be used , but we have to update another table in SAP that is why the RFC,
    My doubt is how the Data type for the sender JDBC should look like , as mentioned I have 2 tables to fetch data from
    <Invoice>
    <Header> 1 -- 1
    <f1>
    <f2>
    <f3>
    </Header>
    <Item> 1--n
    <f1>
    <f2>
    <f3>
    </Item>
    </Invoice>
    The sender JDBC returns
    <Invoice>
    <row>
    <f1>
    <f2>
    <f3>
    </row>
    </Invoice>
    How can I replicate the data type to meet the JDBC sender structure.
    and regarding the mapping do I have to change the occurrunce to 0 -- unbounded
    regarding the update Ragu is right in his suggestion
    Table1 can be used as primary table, Table2 can be used as Secondary table.. u will have key field to link both table.
    So Just Updating only Primary Table(Table1) will helps on this.
    Thanks.

Maybe you are looking for

  • PSE 8 - can I delete Previews?

    I have a bunch of photos I had moved off an old hard drive to CDs with PSE3.  They showed in the organizer as "offline media." I have been moving them to my hard drive (E:\My Pictures\foldersxxx).  For whatever reason, sometimes it went well and I wa

  • ITunes keeps attempting to open

    iTunes keeps opening by itself, even with no device (ipod, iphone) attached. or if working in one windows 7 account, and iTunes is open in another, it keeps attempting to open, and shows an error message, "You cannot open the application "iTunes" bec

  • How to store a relative path in a global variable

    Hi, I'm using Teststand 2013 and Labview 2013 Is it possible to define a relative path for a global variable in the Teststand? Ex. "..\vector1.hws" Or I should use the Labview functions to solve this issue? Thanks, Solved! Go to Solution.

  • CRM-survey doesn't be displayed in a contact-activity

    Hi, I have a problem with CRM (4.0) activities (contact). I am new to surveys but I created one and can't see it in a contact. At first I have created a new survey (SPRO - CRM - Transactions - Seetings for Activities - Questionnaires). Then I have cr

  • No sound from any email i open

    Since upgrading to ML i am not able to hear any sound when opening email attatchments IE WMV files or anything