Stored Procedure issue in receiver JDBC synchronous scenario

Dear Experts,
Below is the description of the Stored Procedure for my requirement which has 1 input and 7 output.
CREATE OR REPLACE PROCEDURE emp_det_proc
    p_emp_id IN NUMBER,
    cur_det OUT sys_refCURSOR
aS
BEGIN
    OPEN cur_det FOR
    SELECT * FROM EMP_PERSON_VIEW
        WHERE id = p_emp_id;
END emp_det_proc;
Inside the procedure , we can see that Select query is done on a VIEW which has some 7 column and these are the output. The data type description of the ID is VARCHAR2 in Oracle Database 11g VIEW, that's why I maintained VARCHAR in Constant mapping at SAP-PI side.
I am maintaining all the column name present in the view for my JDBC request structure with isOutput and type.
Below is my JDBC request.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_ECCJDBC_EmpStrdProc_JDBCReq xmlns:ns0="urn:empdet:sap:jdbc:storedprocedure"> 
- <Statement> 
- <emp_det_proc action="EXECUTE"> 
<table>emp_det_proc</table> 
<ID isInput="true" type="VARCHAR">200178</ID> 
</emp_det_proc>
</Statement>
</ns0:MT_ECCJDBC_EMPStrdProc_JDBCReq>
I tested with other XSD type like INT/CHAR/ but with the same error.
Unable to execute statement for table or stored procedure. 'emp_det_proc' (Structure 'Statement') due to java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'EMP_DET_PROC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
1. I observed that the Key field ID is maintained as NUMBER in Stored Procedure but in the VIEW it is maintained as VARCHAR2.
Could anyone help me to solve the issue  with any suggestions?
Regards
Rebecca

Dear Ramesh,
There are change in the datatype of the Stored Procedure Input parameter. Below is the correct procedure description now.
Select query of the View
My JDBC structure
Observation and querry:
1. In the SP declaration, there is 1 IN parameter which I have  created in JDBC structure as p_moi_id and gave the type as INTEGER.
Error : JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'moi_det_proc' (structure 'Statement'): java.lang.NumberFormatException: For input string: "2*********&49"
I assume since the range of the number is limited . Integers are values up to 2147483647 and the number I am using is greater than this values.
2. I assume I have not included the parameter cur_det as OUT. Instead I have maintained the COLUMN names of Select query of the view. Should I remove all the Out parameters which represents inside the View.
3. What could be the Data type equivalent to Oracle sys_refCURSOR in SAP PI?
Please share you suggestion.
Regards
Rebecca

Similar Messages

  • When would you write a stored procedure in sender/receiver jdbc adapter

    Hi Everybody
    Can you tell any situation where you would need to write a stored procedure in the query sql statement of sender/ receiver jdbc adapter instead of writing SELECT statement there
    why do we need to write stored procedures
    thanks and regards,
    Anitha

    Hi Anitha,
    why do we need to write stored procedures
    Some times a single SQL statement will not suffice for ur transactions....
    Say u want to access from 2 tables and update based on some condition..
    or nested select statement...
    or u want to update a 2 nd table based on the values from 1st table... etc..
    In those places it's preferable for going for a Stored Procedure.
    The Stored Procedure can be used in both Sender and Receiver JDBC Adapter.
    Still nt clarified do post..
    Babu

  • APEX fails with Java stored procedure that creates a JDBC connection

    Hello!
    We are facing a strange problem since we have upgraded from Oracle 10g and Apache to Oracle 11g with Embedded Gateway.
    Here is what we do:
    ** APEXX calls a PL/SQL package function "OPEN_CONNECTION" that wraps a Java stored procedure called "openConnection".*
    FILE_READER_REMOTE_API.openConnection(user, password, host, port, service);
    ** The Java stored procedures "openConnection" opens a JDBC connection to an other database:*
    public class FileReaderRemote {
    private static Connection conn = null;
    private static DefaultContext remoteContext = null;
    public static void openConnection(String user, String password, String host, String port, String service) throws SQLException {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    java.util.Properties props = new java.util.Properties();
    props.put ("user", user);
    props.put ("password", password);
    //props.put ("database", "//" + host + ":" + port + "/" + service);
    props.put ("database", host + ":" + port + ":" + service);
    props.put("v$session.program", "FileReaderRemote2");
    // Connect to the database
    remoteContext = Oracle.getConnection("jdbc:oracle:thin:", props);
    This procedure used to work fine before the upgrade, but now we see the following:
    * It still works when called directly from TOAD or SQL*Plus, even under the user ANONYMOUS.
    * When called from APEX and the target database is Oracle 11g, it still works.
    * When called from APEX and the target database is Oracle 10g, it takes several minutes and we receive this error:
    *"Socket read timed out"*
    We have tested the following workaround:
    We have created a database link to our own database and called the stored procedure through that database link.
    FILE_READER_REMOTE_API.openConnection*@loopback*(user, password, host, port, service);
    This works, but is not really an option.
    I hope some one of you can explain this strange behaviour to me.
    Best regards,
    Matthias

    You wrote
    "Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
    From the Oracle8i Java Stored Procedures Developer's Guide
    Release 8.1.5
    A64686-01
    "If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
    This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
    "If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
    DriverManager.getConnection("jdbc:oracle:kprb:");
    Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
    So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
    Connection conn =
    DriverManager.getConnection(
    System.getProperty("oracle.server.version") == null
    ? "jdbc:oracle:thin:@hostname:1521:ORCL"
    : "jdbc:oracle:kprb:"),
    "youruserid","yourpassword");
    As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
    Regards,
    Steve
    null

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

  • 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

  • JDBC Synchronous Scenario Issue

    Hi,
    I am working on JDBC to RFC which is a synchronous scenario. My sender jdbc channel is configured QoS as Best Effort. Data is getting passed to JDBC to RFC, as this is synchronous the RFC(i.e. response) to JDBC is getting triggered. Now when the RFC to JDBC is triggered i am trying to delete some data in a jdbc table. This delete process is not happening. But in moni both the messages are successfull and in RWB also i couldn't find any error.
    Please help me out.
    Thanks in Advance.
    Regards,
    Sudheer

    Hi Aamir,
    As per your suggestion i have implemented BPM for this scenario and now it is triggering the receiver JDBC channel but in my apapter monitoring i found that my receiver channel is having an error and couldn't process my request.
    I have raised a forum thread for this error, please look at the below link for the same and kindly help -
    JDBC Receiver CC Error
    Looking forward for your help in this regard!!
    Thanks in advance!!

  • JDBC Synchronous Scenario - Receiver Adapter

    Hello All,
         My scenario is I am calling a stored procedure in receiver adapter to inser/update a particular row in SQL Server DB. I am getting the following error :
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'Finalise' (structure 'STATEMENT'): java.sql.SQLException: Unsupported parameter type 'dateTime' for parameter 'StartDate' found
    Element> StartDate(type>xsd:dateTime)
    Attribute-> IsInput(type-->xsd:Boolean)(value=true)
    Attribute>type(type>xsd:String)(value=dateTime)
    XML formed in target request side to SQL server in Call Adapter is
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_XXX xmlns:ns0="http://XXX">
    - <STATEMENT>
    - <StoredProcedureName ACTION="EXECUTE">
    <TABLE>Finalize</TABLE>
    <StartDate IsInput="true" type="datetime">2007-02-02 00:00:00.000</StartDate>
    </StoredProcedureName>
    </STATEMENT>
    </ns0:MT_XXX>

    Hi Ravijeet,
    This error is beacuse of the mismatch in the format.Check in the database what is the type that is defined for StartDate.It might not be dateTime.
    Please do also check if SQL accepts the type as dateTime.
    These are the reason why it throwing the exception "Unsupported parameter type 'dateTime' for parameter 'StartDate' found".
    Trying to change the type to xsd:date in XI and execute it.Please do also take care the format inw hich u send the date.
    Please do let me know if u need furthur information.
    Thanks,
    Bhargav.
    Note:Award points if found useful.
    Edited by: bhargav gundabolu on Mar 7, 2008 3:12 PM

  • JDBC-JDBC Synchronous scenario

    Dear All,
    We have a scenario below and required your valuable inputs:
    From Sender DB system, we have to read 1000 records and update the flag from 0 to 1. PI does the required transformation and using SQL statements, it has to insert in the Target DB system.
    Ex: If 100 records failed in Target DB due to some erros in execution of SQL stmt, we need to send these 100 records back to sender and update the flag 1 to 2.
    FYI.. There are no Stored Procedures at Target DB system.
    We created both Sender/Receiver interfaces as Synchronous interfaces and in the response structure we defined 2 fields to read the primary key of the records, but the response mapping is getting failed.
    because JDBC Receiver adapter is allowing to have only insert_count field as response structure.
    Is there any way that I can read the failed records.
    Please suggest.
    Regards,
    Srinivas

    Hi Srinivas,
    Kindly do like this: Create a JDBC Lookup based on the response with BPM with the Primary Key Fields, Also refer Martens provided blog will helps u a lot.
    For creating JDBC Lookups Please refere the following Blogs:
    /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    Also refer the following threads:
    Re: JDBC Lookup and populate fields for output
    Re: JDBC Lookup
    Re: JDBC Lookup UDF- To fetch multiple values
    Regards
    Venkata Rao .G

  • No response message in Proxy to JDBC synchronous scenario

    Dear Team,
    I am working on synchronous scenario Sender ABAP proxy <===> SAP PI 7.31 <===> Oracle Database.All the necessary proxy configuration has been successfully tested.
    Business Scenario:
    ABAP proxy will send a single Vendor Id to Oracle DB as request and in return , it has to retrieve all the columns related to Vendor as response.Oracle Database stores all the Vendor information.There are 11 columns including the vendor Id in the view for the Vendor records.
    Design :
    For Request structure:
    a-->Created MT for Sender ABAP Proxy with only 1 field for Vendor Id.
    b-->Created MT for Receiver JDBC  with Action as SELECT , Table with "View Name" , Access with Constant Blank for all 11 column and Key as Vendor Id.
    I have been following  the link and Bhavesh Kantilal document.
    http://help.sap.com/saphelp_nw73/helpdata/en/44/7b7171fde93673e10000000a114a6b/content.htm?frameset=/en/44/7b7855fde93673e10000000a114a6b/f
    rameset.htm&current_toc=/en/ca/b977f1c7814201954f20bb87ad7aab/plain.htm&node_id=71
    For Response structure:
    Created MT for Receiver JDBC with All the column names.
    Created MT for target ABAP ECC with the same 11 column name of JDBC response.
    Note :
    1.Database team shared a excel file as a sample payload which has all the column names of a vendor and I created my DT with the same naming conventions as they are maintaining in their database i.e. Column names are in CAPs, in the same order and even the special characters in the column name.
    2. The PING test connection for Cc works fine to database.
    Please read out my queries as the I am not receiving any response from Oracle DB and gives error as timeout exception:
    1.Since I am trying to retrieve all the column of the view , am I doing the correct procedure of putting all the column name in the JDBC request structure and making a Select statement. Can I add < * > to fetch all the column name and if so where can I add it.
    2. Whats the difference between SELECT and SQL_QUERY and on what circumstances I can add it?
    3. How can I test ICO in ID?
    4. Can I use any SOAP tool to test the messages? Is there any functionality in NWA to test the messages directly to JDBC .
    Hope all your inputs can improve my design part.
    Regards
    Rebecca

    Hi Rebecca,
    Did you go through all of these links below?
    PROXY to JDBC- SYNC
    Proxy to JDBC Sync, with Idoc Receiver
    JDBC to PROXY Sync Scenario | SCN
    JBDC Receiver Insert Statement Response
    Re: Synchronous JDBC select
    receiver JDBC structure
    Regards,
    Jannus Botha

  • Stored Procedure for Accounts Receivable

    Hi. First off, apologies in advance if I have put this question into the wrong topic. Secondly, I first saw SAP 3 weeks ago when I stared my new job and have had no training so please bear with me if some of what I ask doesn't make much sense.
    OK, the issue is this.  In SAP B1, there is a built in Report called "Customer Receivables Aging" which allows you to see Customer Receivable Accounts by age (e.g 0-30, 31-60, 61-90, 90+) and so on.  The problem with the built in report is that it doesn't show all the fields I want - it only shows the Customer Name, balance, and then the aging balances.  I want to be able to see things like the customer's contact details, etc. I know this makes no sense because the whole point of the report is to be able to drill down into the different rows, but this report needs to be issued in printed form, hence the need for the extra fields.
    Since I can't seen any way from within SAP to change the fields returned by this report, I thought I'd have a stab at writing my own SQL to select out the same data along with the extra fields I wanted.  That's when the problems began...try as I might, I cannot get my figures to tally with the SAP Report.
    They are almost correct, but not quite. I am sure that I am missing a selection or some other element of the logic that B1 uses to create the built in report.
    If you want, I can post the SQL I'm using....I'm not an SQL guru by any means, but I do know my way around it; the biggest problem I have is that I cannot find any documentation as to the 4 letter tables that SAP uses and their relationships except on the most basic level (e.g ORIN is Open Return Invoice [maybe])
    Then I thought maybe it might be possible to edit that report section in B1 using the SDK.  That would be a better solution as I would not have to 'reinvent the wheel', I can just SELECT an extra field or three to include in the report.
    So my question is
    ->Does anyone have a stored procedure for SQL Server that can replicate correctly the SAP B1 "Customer Receivable Aging", even just the process SAP uses to gather this data would be good.
    OR
    is it possible to edit this report in SAP to put in the extra fields I want.
    Or, am I totally barking up the wrong tree? Thanks in advance, I know this is a long post.

    Hi Stephen,
    There should be a print layout attached to the on-screen report. This can be altered to show the additional fields you want without resorting to SDK or SQL development.
    When you have the Customer Receivables Ageing report open on screen, choose Tools-Print Layout Designer or click on the Print Layout Designer icon on the toolbar. When prompted, choose the layout you wish to edit and you'll be taken to the layout design. In the layout, you can add additional fields and should be able to add most business partner fields. As the report is set to portrait by default, I recommend changing it to landscape so you have lots more space to add the extra fields you want. This report writer is fairly intuitive, if a little basic.
    You will need to save this new report design, set it to be the default layout and then when you select to print the Customer Receivables Ageing report (ie Print Preview or Print) you will see the new report.
    Hope this helps,
    Owen

  • Client Proxy to JDBC synchronous Scenario

    I'm using Proxy--PI---JDBC synchronous shcenario, when i execute the proxy from R/3 it is giving me error "RCVR_DETERMINATION.NO_RECEIVER_CASE_BE" in configuration i have used one inbound receiver determination for request, my question is do i need to have one more reciever determination for response.
    Thanks for help.

    No, you do not have to add additional receiver determination
    Usually in sync scenario, make sure you have one receiver determination, no arbitration.
    If you have condition for receiver detemination, make sure the condition only return one true.
    Liang

  • Legal consolidation stored procedure issue

    Hye everyone,
    I tried to execute the stored procedure SPRUNCONSO and I have this error. For information I already run the FXtrans and my database is empty. I just inputted the values I needed :
    - The method et the percentage in the ownership application
    - The input rates for LC and TOT_EUR in the Rate application
    - Some values in the Reporting application.
    All the input are on the same entity and on the time 2006.JUL.
    I don't have any flow dimension but if I understand well it's not an obligation.
    Executing SPRUNCONSO [REPORTING],[REEL],[TOT_EUR],[SPSCOPE_250359],[SPLOG_135291]
    SPRunConso Version 7.0.115
    Warning : Nothing Extract From Ownership for OPENING Period 
    *ERROR* CSD-150 Problem extracting Data : C_REPART 
    *ERROR* CSD-160 Problem extracting Data : C_CONSO 
    20060700 - 3 Rows Calculated
    20060700 - 3 Rows Updated
    The weird thing is that unless the failing during the execution the rows are crrectly inserted. If I delete the parameter scope_table the execution is succesfull but there is no rows calculated.
    I hope to be clear.
    Thank you in advance for your Help
    Franck

    Hi again Franck,
    In fact, this message is not necessarily an indication of an error in the script  or data, even though it appears so and is misleading. There is nothing wrong when you receive this except for the fact that I believe it to be a bit confusing for users.
    In summary, regarding the two errors : ERROR CSD-150  and ERROR CSD-160, the underlying error is a known issue and should be fixed in a future release.                                                         
    For now, you can use the provided workaround to get rid of those error messages.
    Hope this answers your question.
    Kind Regards,
    Patrick

  • SOAP to JDBC Synchronous scenario

    Hi experts
    As per my requirement iam going to do SOAP to JDBC.
    Please guide me how to do SOAP to JDBC (synchronous)
    through XI .any step by step docs or blogs related to this
    please forward to
    [email protected]
    if helpful points will be rewarded.
    Regards,
    Naresh

    hi..
    To send SOAP request u have to download the Altova XML spy tool..
    follow this link for SOAP adapter.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    for JDBC receiver adapter follow
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    regards
    MAnas
    reward if helpful..

  • Stored procedure design(IDoc to JDBC)

    I need design inputs from you people,
    My requirement as follows, we are creating orders(IDoc) in SAP and want to insert data in to Data base table, one IDoc data to be inserted in to multiple tables(min 4).I developed interfaces it is working fine, sometimes we expect 50k orders  from SAP per day,i.e 50K IDocu2019s , it min 2lac insert operations  performing on data base ,so planning to change my design.
    How can I reduce number of insert statements to process 50k IDocu2019s per day.
    Using stored procedure one option but stored procedure structure bit different. Like if I want to insert data 10 times in to data base table, then I written logic to repeat access tag multiples times.
    But how can I do it stored procedure.
    Any pointers?

    You can seek help from JDBC guys to create a Stored Procedure which accept the structure once and distribute it to 4 tables. So you need to push data only once.
    Like if I want to insert data 10 times in to data base table, then I written logic to repeat access tag multiples times.
    This part can also be handled in SP.
    Regards
    Raj

  • Using a stored procedure for a  sender jdbc adapter

    Hi all,
    The requirement is to use a stored procedure, for extracting data from a oracle database.
    Is it possible to do this.
    If yes, what should be the source structure in this case.
    Please help with the exact soln.
    Thanks!!
    Younus

    Hi,
    Did you check the blog pointed by Aamir?
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    You will need to use Oracle Functions instead of Oracle Stored Procedures. Read thru the blog and the note pointed in the blog . Think it is quite a good example.
    Regards
    Bhavesh

Maybe you are looking for