Stored procedure between two scenarios.

Hi All,
I need to call Oracle Stored procedure between two scenarios.
My first scenario is file to JDBC. Ather that i need to call a Stored Procedure and once it is executed i need to trigger another scenario which is JDBC to File.
I can call SP in OS comands but can anybody tell to how to initiate the JDBC to File scenario after SP?
Thanks,

After you receve the message in BPM and call the JDBC adapter, have a send step (syn). This should use a synchronous interface. The message type should be SQL XML for calling SPs (Check help.sap.com for JDBC receiver adaptoer SQL XML format). Once this step is done, you have to receive the response into the container variable of the asyn interface for file. Then have an asyn send step to write to file.
Receive (Async)->Send (Async JDBC)->Send (Sync JDBC call SP, Since sync, you would get the response)->Send (Async File)
VJ

Similar Messages

  • JDBC(using stored procedure) to RFC Scenario

    Hi
    I am doing JDBC(using stored procedure) to RFC Scenario
    While running the scenario i am getting the following error
    Database-level error reported by JDBC driver while executing statement 'EXECUTE EMU.EXTRACTRECON'. The JDBC driver returned the following error message: 'com.ibm.db2.jcc.a.SqlException: [ibm][db2][jcc][10100][10910] java.sql.Statement.executeQuery() was called but no result set was returned. Use java.sql.Statement.executeUpdate() for non-queries.'. For details, contact your database server vendor.
    Can anybody sortout my problem
    Regards
    sunilreddy

    Hi,
    i am doing the scenario file to rfc scenario.
    when i run my scenario xi system is picking the data from file system
    but rfc is not accepting the data.this is the error i am getting
    Delivery of the message to the application using connection RFC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Exception thrown in method process. The transaction is marked for rollback.: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback..
    so please any one give me the solution for that

  • How to call PL/SQL stored procedure with TWO or more arguments from URL?

    Hi all,
    does anybody know, how to call stored procedure with more than one argument?
    How to do this with one argument is known -
    <img src="#OWNER#.retreive_img_data?i_id=#IMG_ID#" width="70" height="80" alt="No Picture">
    But if I need to call procedure with two formal parameters? And need to pass through URL, for example, two page item values?

    Just separate with an "&". Using your previous example, I'll add i_name and i_type:
    <img src="#OWNER#.retreive_img_data?i_id=#IMG_ID#&i_name=somename&i_type=jpg" width="70" height="80" alt="No Picture" />
    Tyler

  • Stored Procedure for two databases

    Hi,
    How we will get the response from the stored procedure i.e in which way?
    Somebody can help me please.....
    Thanks & Regards
    Radhika

    Hi Radhika
    Refer this link ..it will help you
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/jdbcTOJDBC&
    Best Regards,
    Srikanth     
    Reward the useful answers and you will get one point yourself

  • Problem with Stored procedure in JDBC Synch scenario

    Hello Experts,
    I am working on the scenario which is from HTTP <-> to <-> JDBC. It is a synchronouse scenario. We are using Stored procedure in this scenario.
    1) Please send the response structure for it.
    2) here when i am sending request to the Database it is giving me below error :
    Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'TCS.PKG_BMF_MANAGE_SERVICE_DATA.PROC_GET_ACTIVE_MF_ESIIDS' (structure 'statement'): java.sql.SQLException: Oracle CLOB Helper: java.lang.AbstractMethodError: java/sql/Clob.setString(JLjava/lang/String;)I. Setting message to status failed.
    One of the field in Database stored procedure is of type CLOB. So can you ppl guide me that what might be the solution for this.
    Any help appriciated.
    Thanks,
    Hetal

    I am using Stored procedure and that is working fine in Oracle
    This is my XI Request structure :
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:read_PROC_GET_ACTIVE_ESIIDS xmlns:ns0="http://reliant.com/xi/BMFR2">
    - <statement>
    - <PROC_GET_ACTIVE_ESIIDS action="EXECUTE">
      <table>TCS.PKG_BMF_MANAGE_SERVICE_DATA.PROC_GET_ACTIVE_MF_ESIIDS</table>
      <in_bmf_partner_id isInput="true" type="VARCHAR">994</in_bmf_partner_id>
      <in_esids isInput="true" type="CLOB">1008901001155950587100:1008901001155950545100:1008901001155950671100:1008901001155950114100</in_esids>
      </PROC_GET_ACTIVE_ESIIDS>
      </statement>
      </ns0:read_PROC_GET_ACTIVE_ESIIDS>
    This is oracle Stored procedure signature :
    PROCEDURE PROC_GET_ACTIVE_ESIIDS
    in_bmf_partner_id           IN   kss_activity_stg_curr_stat.BMF_PARTNER_ID%TYPE,
    in_esids                    IN   CLOB,
    out_recordset               OUT  sys_refcursor
    Let me know if you need any further information.
    Thanks,
    Hetal

  • Out of memory error when calling a java stored procedure multiple times

    Trying to run a PL/SQL loop calling a java stored procedure, I get the following error:
    "ORA-04030: out of process memory when trying to allocate 262188 byte callheap,ioc_allocate free)"
    (with some other error lines).
    The stored procedure does two major things:
    1) Open a socket to communicate with a server, of which it queries some data.
    2) Use JDBC (with the default DB connection it has, as a stored procedure) to write the results to a table.
    All socket connections, statements, etc. are properly closed and all memory should be garbage collected between each call.
    Can anyone offer an explanation or additional checks to make? I'm quite sure the code isn't causing the problem, since I've tried running it as a stand alone application (outside of Oracle) and didn't have any problems.
    Thanks.

    Hi,
    Verify that the database parameters are set correctly.
    EA

  • Calling stored procedure with output parameters in a different schema

    I have a simple stored procedure with two parameters:
    PROCEDURE Test1(
    pOutRecords OUT tCursorRef,
    pIdNumber IN NUMBER);
    where tCursorRef is REF CURSOR.
    (This procedure is part of a package with REF CURSOR declared in there)
    And I have two database schemas: AppOwner and AppUser.
    The above stored procedure is owned by AppOwner, but I have to execute this stored procedure from AppUser schema. I have created a private synonym and granted the neccessary privileges for AppUser schema to execute the package in the AppUser schema.
    When I ran the above procedure from VB using ADO and OraOLEDB.Oracle.1 driver, I got the following error when connecting to the AppUser schema:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    but when I was connecting to the AppOwner schema, everything is running correctly without errors.
    Also, when I switch to the microsoft MSDAORA.1 driver, I can execute the above procedure without any problems even when connecting to the AppUser schema.
    I got this error only when I am trying to execute a stored procedure with an output parameter. All other procedures with only input parameters have no problems at all.
    Do you know the reason for that? Thanks!

    If anyone has figured this one out let me know. I'm getting the same problem. Only in my case I've tried both the "OraOLEDB.Oracle" provider and the "MSDAORA" provider and I get an error either way. Also my procedure has 2 in parameters and 1 out parameter. At least now I know I'm not the only one with this issue. :)
    '*** the Oracle procedure ***
    Create sp_getconfiguration(mygroup in varchar2, myparameter in varchar2, myvalue out varchar2)
    AS
    rec_config tblconfiguration.configvalue%type;
    cursor cur_config is select configvalue from tblconfiguration where configgroup = mygroup and configparameter = myparameter;
    begin
    open cur_config;
    fetch cur_config into rec_config;
    close cur_config;
    myvalue := rec_config;
    end;
    '** the ado code ****
    dim dbconn as new adodb.connection
    dim oCmd as new adodb.connection
    dim ors as new adodb.recordset
    dbconn.provider = "MSDAORA" 'or dbconn.provider = "OraOLEDB.Oracle"
    dbconn.open "Data Source=dahdah;User ID=didi;Password=humdy;PLSQLRSet=1;"
    set ocmd.activeconnection = dbconn
    cmd.commandtext = "{call fogle.sp_getconfiguration(?,?)}"
    'i've also tried creating a public synonym called getconfiguration and just refering to procedure by that.
    ' "{call getconfiguration(?, ?)}"
    ' "{call getconfiguration(?,?, {resultset 1, myvalue})}"
    'and numerous numerous other combinations
    set oPrm = cmd.createparameter("MYGROUP", advarchar, adparaminput, 50, strGrouptoPassIn$)
    cmd.parameters.append oPrm
    set oPrm = cmd.createParameter("MYPARAMETER", advarchar, adParamInput, 50, strParameterToPassIn$)
    cmdParameters.append oPrm
    set rs = cmd.execute

  • 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

  • Missing parameter in stored procedure

    Hi all,
    I am new to Crystal Report, and I am facing this situation:
    a file .rpt reporting results of a sql server stored procedure, which takes one parameter in input.
    This .rpt is invoked by an .net web service, via libraries, passing the parameter.
    Now I evolved this stored procedure by adding a new parameter. Each of the two parameter is optional; the stored
    procedure returns correctly formatted data with one parameter, the other one, both or none.
    Then I adapted the .rpt file so that it can manage the updated stored procedure, via "Verify Database" istruction.
    Also the .rpt has obviously two input parameters now, with a default value.
    The problem is, the web service acting as handler gives the error "Missing parameter values", because actually it is passing still
    one parameter.
    If I update the web service code by passing both parameters, even with null value, it works, but for internal reasons I can't deploy
    this updated code now
    So, there is a way by modifying the .rpt using a stored procedure with two parameters, to make the invocation successfully even with one input parameter ?
    The missing parameter would have, in the execution logic now, value null or default; it could fit for me.
    Thanks in advance to everyone who will give advice!

    Thanks Don for your answer.
    Unless you change the SP so it has the logic to accept only one value which depends on the parameter type, if they are both strings for example then your SP can use logic the determine what/which param to fill and null the other one.
    What do you mean? Now if I call my stored procedure from SQL Server management studio with this command
    EXEC     [dbo].[StoredProcedureForCR] @FirstParameter = 2
    so, passing only the first parameter, I have no error.
    Which improvements to the SP are you suggesting?
    If I modify the web service, the CR is working, but I cannot deploy it in production for internal reasons related to the company
    Now I am planning these attempts:
    - calling the stored procedure via a command
    - creating in sql server a view and then filtering results in the report
    Do you think they could make sense ?
    Have a nice monday!
    Lidia

  • Calling stored procedure from VB using OraOLEDB.Oracle

    I have a simple stored procedure with two parameters:
    PROCEDURE Test1(
         pOutRecords OUT tCursorRef,
         pIdNumber IN NUMBER);
    where tCursorRef is REF CURSOR.
    (This procedure is part of a package with REF CURSOR declared in there)
    And I have two database schemas: AppOwner and AppUser.
    The above stored procedure is owned by AppOwner, but I have to execute this stored procedure from AppUser schema. I have created a private synonym and granted the neccessary privileges for AppUser schema to execute the package in the AppUser schema.
    When I ran the above procedure from VB using ADO and OraOLEDB.Oracle.1 driver, I got the following error when connecting to the AppUser schema:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    but when I was connecting to the AppOwner schema, everything is running correctly without errors.
    Also, when I switch to the microsoft MSDAORA.1 driver, I can execute the above procedure without any problems even when connecting to the AppUser schema.
    I got this error only when I am trying to execute a stored procedure with an output parameter. All other procedures with only input parameters have no problems at all.
    Do you know the reason for that? Thanks!

    This forum is meant for discussions about OTN content/site and services.
    Questions about Oracle products and technologies will NOT be answered in this forum. Please post your product or technology related questions in the appropriate product or technology forums, which are monitored by Oracle product managers.
    Product forums:
    http://forums.oracle.com/forums/index.jsp?cat=9
    Technology forums:
    http://forums.oracle.com/forums/index.jsp?cat=10

  • Is it possible to pass a null Input Oracle parameter to a stored procedure

    I have a stored procedure that take 3 inputs and gives 1 output.I'm using Oracle parameter to add all 3 input parameters as follows :
    OracleParameter inobj = cmd.Parameters.Add("wid", OracleDbType.Int32,50);
    inobj.Direction = ParameterDirection.Input;
    inobj.Value = _employeeID;
    and added the output parameter as follows:
    OracleParameter outobj = _cmd.Parameters.Add("w_first", OracleDbType.Varchar2, 50);
    outobj.Direction = ParameterDirection.Output;
    On the UI end , the user has a choice to provide 1 input or all inputs or any 2 inputs based on his interest. Stored Proc looks as follows:
    SP( inp1 in parameter, inp2 in parameter, inp3 in parameter, output1 out parameter)
    If i just get 1 input or 2 inputs from the user, is it fine to query the data for output using same stored procedure or should i have individual stored procedures for each scenario(combination of different inputs)?
    Will i get any pl/sql error that says invalid number of arguements?

    This means if i have 1 input , i need to have a different method to pass 1 parameter value and other input parameters as null and if there are 2 inputs will need different method to handle. So 5 different methods all together?
    What if the stored procedure is as follows ,will its make things easier so that only one method is used for all scenarios?(optional parameters is set default value as null in the stored proc)
    Create or Replace
    Procedure GetFoo
    (cur_z OUT sys_refcursor,
    pub_date IN varchar2,
    fname IN varchar2 default null,
    lname IN varchar2 default null,
    phone IN varchar2 default null
    IS
    BEGIN
    ---get some data
    END;
    *actually i can test this but, all the database servers are down today. So, i need to have idea if this thing works before i confirm with someone. Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Calling stored procedures from entity object and application module

    Hello
    I've put in place an EntiyImpl base class containg helper methods to call stored procedures.
    I now need to call stored procedures from the application module.
    Apart from creating an application module base class and duplicating the helper method code is there a way
    to share the helper methods for calling stored procedures between the entity impl and application module impl ?
    Regards
    Paul

    Does the helper code depend on features of a particular entity object instance, beyond its database transaction?
    If so, I'm not sure I see how it could be used from an application module class.
    If not, here's what you do:
    Step 1:
    Parametrize the database transaction--you might even want to. So instead of
    protected myHelperMethod(Object someParam) {
    DBTransaction trans = getDBTransaction();
    change this to
    protected myHelperMethod(DBTransaction trans, Object someParam) {
    Step 2: make the method public and static--once you parameterize the DBTransaction, you should be able to do this.
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    Step 3: Remove the method from your EntityImpl base class into a utility class:
    public abstract class PlSqlUtils {
    private PlSqlUtils() {}
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    When you want to call the method from an application module, entity object, or even view object class, call
    PlSqlUtils.myHelperMethod(getDBTransaction(), paramValue);
    Unlike Transaction.executeCommand(), this lets you provide functionality like setting procedure parameter values, retrieving OUT parameter values, etc.
    Hope this helps,
    Avrom

  • Error executing a stored procedure from SSIS using the MERGE statement between databases

    Good morning,
    I'm trying to execute from SSIS a stored procedure that compares the content of two tables on different databases in the same server and updates one of them. To perform this action, I've created a stored procedure in the destination database and I'm
    comparing the data between tables with the MERGE statement. When I execute the procedure on the destination database the error that I obtain is:
    "Msg 916, Level 14, State 1, Procedure RefreshDestinationTable, Line 13
    The server principal "XXXX" is not able to access the database "XXXX" under the current security context."
    Some things to take in account:
    1. I've created a temporary table on the same destination database to check if the problem was on the MERGE statement and it works fine.
    2. I've created the procedure with the option "WITH EXECUTE AS DBO".
    I've read that it can be a problem of permissions but I don't know if I'm executing the procedure from SSIS to which user/login I should give permissions and which.
    Could you give me some tip to continue investigating how to solve the problem?
    Thank you,
    Virgilio

    Read Erland's article http://www.sommarskog.se/grantperm.html
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • "Best Practice" for a stored procedure that needs to access two schemas?

    Greetings all,
    When my company's application is deployed, two schema owners are typically created and all database objects divided between the two. I'll call them FIRST and SECOND.
    In a standard, vanilla implementation there is never any reason for the two to "talk to each other". No rights to objects in one schema are ever granted to the other.
    I am currently charged, however, with writing custom code to roll up data from one of the schemas and update tables in the other with the rollups. I have created a user whose job it is to run this process, and this user has the proper permissions to all necessary objects in both schemas. I'll call this user MRBATCH.
    Typically, any custom objects, whether they be additional staging tables, temp tables or stored procedures are saved in the FIRST schema. I tried to save this new stored procedure in the FIRST schema and compile it, but got "Insufficient priviliges" errors whenever the code in the stored procedure tried to access any tables in the SECOND schema. This surprised me a little bit because I had no plans to actually EXECUTE the stored procedure as FIRST, but I guess I can understand it from the point of view of, you ought be able to execute something you own.
    So which would be be "better" (assuming there's any difference): Grant FIRST all of the rights it needs in SECOND and save the stored procedure in FIRST, or could I just save the stored procedure in the MRBATCH schema? I'm not sure which would be "better practice".
    Is there a third option I'm overlooking perhaps?
    Thanks
    Joe

    In this case I would put it again into schema THIRD. This is a kind of API schema. There are procedures in it that allow some customized functionality. And since you grant only the right to execute those procedures (should be packages of cause) you won't get into any conflicts about allowing somebody too much.
    Note that this suggestion seems very similiar to putting the procedure directly to the executing user MRBATCH. It depends how this schemauser is used. I always prefer separating users from schemas.
    By definition the oracle object to represent a schema is identical to the oracle object representing a user (exception: externally defined users).
    my definition is:
    Schema => has objects (tables, packages) and uses tables space
    User => has priviledges (including create session and connect) and uses temp tablespace only. Might have synonyms and views.
    You can mix both, but sometimes it makes much sense to separate one from the other.
    Edited by: Sven W. on Aug 13, 2009 9:51 AM

  • File to JDBC Scenario using stored procedure Question

    Does anyone have an aswer (or have you seen a Blog that covers it) to the problem of having to do a table refresh before doing inserts in a file 2 jdbc scenario?
    Essentially the details are as follows:
    I have an input file that has all the data for a table (it's a complete table dump) of lets say userdata (username, name, hiredate).
    I need to pass that to an oracle database via stored procedure(s).  But before I start issuing my insert (via insert stored procedure) I have to somehow issue a delete statement to delete all the contents of the table I'm about to update.  I'm on XI 3.0 and aren't sure what the best solution to this may be.
    Again if there is a blog that covers this then if you could point me in that direction it would be great.  Otherwise if anyone has any good ideas it would be appreciated.

    Hi,
    For structure refer this blog..
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Use two <Statement> tags as shown here and there you may have separate tablenames.
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    Thanks,
    Jogula Ramesh

Maybe you are looking for

  • Error in Installing SSO Metadata Repository Creation Assistant (10.1.4.3.1)

    I am trying to Install Portal Forms Reports 11, so I had to Install all prerequisites My Machine Specifications:- 1- Oracle Enterprise Linux 5.5 x86-64 2- DB 11g R2 3- WebLogic 10.3.3 (X64) 4- Oracle Identity Management 11.1.1.2.0 I was executed the

  • Solution manager system log - strange entries

    Hi Everyone, the problem we are facing in Solution Manager system log every five minutes appears a new error message: 2 Database error -30082 at CON 0 > SQL30082N Security processing failed with reason "24" 0 > ("USERNAME AND/OR PASSWORD INVALID"). S

  • Steps to solve a problem

    Please confirm me the steps to download a video while browsing in internet? Next how to download videos,or mp3 via nokia 5070 while browsing in internet but at the PC. please tell me the ways to download some creature completely

  • Partner function AG (Sold-to-party) - read the partner code

    Hi All! I tried to write an ABAP code to get the alphanumeric key, which clearly identifies the partner with partner function AG (Sold-to-party) and RE (Bill-to-party) for the Outbound delivery. I want to compare this two values and output an message

  • Number Range for Contact persons in SAP CRM

    Hi Experts, Can anyone brief me about the contact persons concept in CRM and ERP? How and where the the no. ranges are maintained , config settings, link between ERP and CRM? Standard Account group for contact persons in ERP and CRM? I would apprecia