How to call a write procedures which has output parameters in an xsodata service?

Hi,
I have a use case where we call a Stored procedure from an xsodata service, where in I also need some output from procedure.
We couldn’t achieve this because whenever I pass some output from my procedure , framework is considering the response as an error always.
Looks like we cannot pass back any values apart from errors.
Since we are doing some insert statements in our procedure I couldn't even wrap the procedure using calculation view
because from calculation view we can call only call only read only procedure.
What is the right way of calling a write procedure which returns some output always apart from error from an xsodata service?
Thanks and Regards,
Arjun

Another suggestion Arjun,
you said you have a writeable procedure with you, which will return a result set after the processing. You split the procedure into two, one writeable and one read only, so that the writeable will update the data, and read only procedure would return the required result set. The, use xsjs to call the writeable, and use xsodata to call the read only procedure(complicate it man ). 
Sreehari

Similar Messages

  • How to call a stored procedure which has out parameter value

    my code is
    public Connection createConnection() {
                   Connection conn = null;
                        try {
                             Class.forName(DRIVER);
                             conn = DriverManager.getConnection(URL,USER,PASS);
                        } catch (ClassNotFoundException cnfe) {
                             System.err.print("Class not found");
                        } catch (SQLException sqle) {
                             System.err.print("SQLException");
                   return conn;
         public static void main(String args[]){
              StroedProcedure stp = new StroedProcedure();
              Connection con = stp.createConnection();
              try {
                   CallableStatement stproc_stmt = con.prepareCall("{call Account_Summary(?,?,?,?,?,?,?,?)}");
                   stproc_stmt.setString(1, "123456");
                   stproc_stmt.setDate(2, null);
                   stproc_stmt.setString(3, null);
                   stproc_stmt.setString(4, null);
                   stproc_stmt.setString(5, null);
                   stproc_stmt.setString(6, null);
                   stproc_stmt.setDate(7, null);
                   stproc_stmt.setDate(8, null);
                   stproc_stmt.registerOutParameter(1,Types.CHAR);
                   stproc_stmt.registerOutParameter(2,Types.DATE);
                   stproc_stmt.registerOutParameter(3,Types.CHAR);
                   stproc_stmt.registerOutParameter(4,Types.CHAR);
                   stproc_stmt.registerOutParameter(5,Types.CHAR);
                   stproc_stmt.registerOutParameter(6,Types.CHAR);
                   stproc_stmt.registerOutParameter(7,Types.DATE);
                   stproc_stmt.registerOutParameter(8,Types.DATE);
                   stproc_stmt.execute();
                   System.out.println("test "+stproc_stmt.getString(1));
                   ResultSet rs = stproc_stmt.executeQuery();
                  while (rs.next()){
                       System.out.println("result "+rs.getString("ACCPK"));
              } catch (SQLException e) {
                        e.printStackTrace();
         }And the stored procedure is
    CREATE OR REPLACE
    procedure Account_Summary (accpk in out char, incdt out date, bcur out char, bmark out char, tarTE out char, numHold out char, stDt out date, AsDt out date)
    is
    begin
    select account_pk, inception_date, base_currency, benchmark  into accpk, incdt, bcur, bmark
    from account a
    where a.Account_pk=accpk;
    select target_te, number_holdings, start_date, as_date into tarTE, numHold, StDt, AsDt
    from acc_summary asum
    where asum.account_pk=accpk;
    end Account_Summary;but it gives a exception ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "REPRO.ACCOUNT_SUMMARY", line 4
    ORA-06512: at line 1
    i want to execute a stored procedure which has in , inout or out parameter
    but it can not work

    ========================
    In some contects varchar2 variable limit is 32512 characters... October 16, 2003
    Reviewer: Piotr Jarmuz from Poznan, Poland
    Interesting to note is the fact that varchar2 variables as parameters to stored
    procedures (in in/out out) may be "only" 32512 bytes long.
    I've checked this in Java and Perl. 32512 is the last value that works, for any
    bigger it throws:
    Exception in thread "main" java.sql.SQLException: ORA-01460: unimplemented or
    unreasonable conversion requested
    But in PL/SQL as you said 32767
    Regards,
    Piotr
    =================================
    This i got it from ask tom, well it make sense.... try checking your input with small numbers and strings
    Have fun

  • How to call a stored procedure that has Table Of data types in VB6?

    Hi everyone,
    I need to call a stored procedure that has a Table Of data type as an input parameter (possibly even several Table Of input parameters). I can't seem to find any example of how to do this in VB6 using ODBC. Is this even possible?
    Thanks you!
    Steve

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • How to extract data from MBO which has input parameters

    Dear All,
    I have a requirement to show the material price and material stock.I have created MBOs which takes Plant and Material as its input.
    I have to make an android native application which will show the material stock and material price according to the input Material and Plant.
    So how can I extract data from these MBOs ?

    Have you already got the BAPIs details? If yes please check their structures and see how they are related to get the desired output. You should consult an abaper for this requirement.
    Meanwhile, you can check these posts:
    A workflow Application to Release A Purchase Order...
    Developing SAP Android Mobile app from scratch - Part 1
    Regards,
    Jitendra

  • Can I call a stored procedure which has DMLs from a function ??

    Hello all,
    Here is my req. I Want to use a function which in turn executes a procedure to populate a table. This procedure inserts data into a table .
    How can I make it work.?
    thanks,
    Dnakka

    Hi,
    Here is an example procedure and a function.
    The procedure:
    CREATE OR REPLACE PROCEDURE proc1 AS
    BEGIN
    INSERT INTO tab1 VALUES(1, 'some string value');
    COMMIT;
    END;
    The function which calls proc1:
    CREATE OR REPLACE FUNCTION func1 RETURN VARCHAR2 AS
    BEGIN
    proc1;
    RETURN 'done';
    END;
    Hope that helps.
    Savitha.

  • Is there any way to call a sub vi which has input parameters and not wait until it finishes executing?

    Hi,
    I have a main vi that I would like to call a sub vi from and have the main vi continue on without waiting for the sub vi to finish. I can open a reference to the sub vi and invoke the "run" method, but in this fashion, I cannot pass any parameters to the sub vi. Or, I can use a call by reference node where I can pass parameters, but there is no option to not "wait until done". How can I do this? Is global variables the only way?
    Thanks!

    Use the method Set Control Value before you invoke Run. You specify the exact name of the control and the data you want to pass needs to be flattened to a string.

  • How to call a Oracle Proc,which contains Object Type as in Param, from java

    Hi
    Would like to know how to call a Oracle Procedure which contains the Object Type Parameter from java.
    Here is my code will look like...
    1. CREATE OR REPLACE TYPE emp AS OBJECT
    Empno NUMBER,
    Ename VARCHAR2(50)
    [COLOR=royalblue]In step1 I have created object type.[COLOR]
    2.CREATE OR REPLACE PACKAGE ref_pkg IS
    TYPE tab_emp IS TABLE OF emp;
    END ref_pkg;
    [COLOR=royalblue]In step2,I have created a table type which is of type emp;[COLOR]
    3. CREATE OR REPLACE PROCEDURE p_emp(p_emptab IN ref_pkg.tab_emp) as
    BEGIN
    FOR I IN 1..p_emptab.COUNT
    LOOP
    Some code written here
    END LOOP;
    END;
    [COLOR=royalblue]In step3 I have passed tabletype which is of type emp as argument.[COLOR]
    Now I need to invoke this procedure from JAVA.
    Calling a procedure doesn�t matter.
    But how I can map objecttype ? how will java recognize oracle object ?
    How can I implement this ?
    Any Help/Clues is Appreciated.
    Thanks
    Krishna

    Hi Bob
    You can call a stored proc from a database control with the jc:sql annotation itself.
    Assume a stored proc taking one In parameter
    * @jc:sql statement="call sp_updateData({id})"
    void call_sp_updateCust(int id);
    You can even call stored proc with OUT parameters using
    * @jc:sql statement="{call sp_MyProc(?, ?)}"
    void call_sp_MyProc(SQLParameter[] params)
    You can also call stored functions via db control.
    More info and diff ways to call at
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
    Thanks
    Vimala

  • How to call a stored procedure using its package name in Oracle

    hi
    we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
    i have got 2 queries:
    1- How to call the stored procedure using it's package.
    2- How to capture the In/Out parameter in the response.

    hi Prateek
    thanks for the reply.
    However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
    As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
    How to get the IN-OUT parameter in XI?

  • IB:How to update a serial Number which has Inventory Material Transactions?

    Dear friends
    first of all thanks for your time and valuable solutions
    Install base: How to update a serial Number which has Inventory Material Transactions
    problem description:
    Install base > quick search
    Here is Installbase record, when I query from quick search
    Rec#     Item          Item Instance           Serial Number          Status
    1     300-7000-01      3000000           1000XXX-0538JQ0003 Return for Adv Exchange
    2     300-7000-01     8000000               1000XXX-0538JQ0003-     Return for Adv Exchange
    3     300-7000-01     5000000               1000XXX-0538JQ0003-A     Return for Adv Exchange
    looking above data, first and third records are the legitimate serial numbers(correct according to the client specs), second record is not legitimate since it has a dash as suffix, we found there are many illegitimate serial Numbers exists, needs to be updated with the right serial Numbers which I analyzed in excel after pulling data from mtl_material_transactions , oe_order_lines_all , mtl_serial_numbers , mtl_system_items_b
    basically these are all RMAs
    I need to update the second record as 1094SUZ-0538JQ0003-B as per the guidelines, while updating I need to keep all the existing contracts, Warranty, what ever material transations it has, need to be same.
    we have a package updating the serial numbers using IB API (csi_Item_Instance_Pub.update_item_instance) but it is updating only the records which has no serial numbers present for that instance, if there is a serial number already exists it is not working.
    user define error msg "Serial Number 1094SUZ-0538JQ0003- has Inventory Material Transactions. This serial number cannot be used to update an existing Item Instance", but I need to update this anyway!! or am I missing something here, please advice me
    below post looks like similar issue, talks about hard update, I have no clue, by doing that the updated serial number will have same transations, contracts, dates....attached to it like the previous serial number
    IB UPDATE_ITEM_INSTANCE ERROR - doesn't allow ACTIVE_START_DATE to change
    would be great If you guys help me out, really appreciated!!
    unfortunately I couldn't find any solutoin in metalink for the existing serial number update
    code for updating the serial number using IB API
              x_msg_count := 0;
    x_msg_data := '';
    p_instance_rec.instance_id := rec.child_instance_id;
    p_instance_rec.serial_number := rec.child_serial_number;
    p_instance_rec.object_version_number := rec.child_object_number;
    p_txn_rec.transaction_id := Fnd_Api.g_miss_num;
    p_txn_rec.transaction_date := SYSDATE;
    p_txn_rec.source_transaction_date := SYSDATE;
    p_txn_rec.transaction_type_id := 1;
    csi_Item_Instance_Pub.update_item_instance
    p_api_version => 1.0,
    p_commit => Fnd_Api.g_false,
    p_init_msg_list => Fnd_Api.g_false,
    p_validation_level => 1,
    p_instance_rec => p_instance_rec,
    p_ext_attrib_values_tbl => p_ext_attrib_values_tbl,
    p_party_tbl => p_party_tbl,
    p_account_tbl => p_account_tbl,
    p_pricing_attrib_tbl => p_pricing_attrib_tbl,
    p_org_assignments_tbl => p_org_assignments_tbl,
    p_asset_assignment_tbl => p_asset_assignment_tbl,
    p_txn_rec => p_txn_rec,
    x_instance_id_lst => x_instance_id_lst,
    x_return_status => x_return_status,
    x_msg_count => x_msg_count,
    x_msg_data => x_msg_data
    Thanks
    Suri

    Suri
    Used this. May not be perfect but should get you there. Only if the table is registered (all the seeded tables should be registered) this will work.
    select distinct a.table_name,b.column_name from fnd_tables a, fnd_columns b
    where a.table_id=b.table_id
    and upper(b.column_name) like '%SERIAL%'
    Also this is very old one but if you need history for this change add the history insert logic as well..
    DECLARE
    l_return_err VARCHAR2 (80);
    PROCEDURE debug (p_message IN VARCHAR2)
    IS
    BEGIN
    dbms_output.put_line (SUBSTR (p_message, 1, 255));
    END debug;
    BEGIN
    debug('======================================================================');
    debug('Switching from serial number XDT07406. to XDT07406 ');
    debug('======================================================================');
    UPDATE fa_additions_b
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in fa_additions_b updated :'||sql%rowcount);
    UPDATE fa_mass_additions
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in fa_mass_additions updated :'||sql%rowcount);
    UPDATE rcv_serial_transactions
    SET serial_num = 'XDT07406'
    WHERE serial_num = 'XDT07406.';
    debug('No of rows in rcv_serial_transactions updated :'||sql%rowcount);
    UPDATE mtl_serial_numbers
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in mtl_serial_numbers updated :'||sql%rowcount);
    UPDATE mtl_unit_transactions
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in mtl_unit_transactions updated :'||sql%rowcount);
    UPDATE csi_item_instances_h
    SET new_serial_number = 'XDT07406'
    WHERE new_serial_number = 'XDT07406.';
    debug('No of rows in csi_item_instances_h updated :'||sql%rowcount);
    UPDATE csi_t_txn_line_details
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in csi_t_txn_line_details updated :'||sql%rowcount);
    UPDATE csi_item_instances
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in csi_item_instances updated :'||sql%rowcount);
    UPDATE wsh_delivery_details
    SET serial_number = 'XDT07406'
    WHERE serial_number = 'XDT07406.';
    debug('No of rows in wsh_delivery_details updated :'||sql%rowcount);
    debug('======================================================================');
    debug('Switching from serial number jct20591 to JCT20591 ');
    debug('======================================================================');
    UPDATE fa_additions_b
    SET serial_number = 'JCT20591'
    WHERE serial_number = 'jct20591';
    debug('No of rows in fa_additions_b updated :'||sql%rowcount);
    UPDATE fa_mass_additions
    SET serial_number = 'JCT20591'
    WHERE serial_number = 'jct20591';
    debug('No of rows in fa_mass_additions updated :'||sql%rowcount);
    UPDATE rcv_serial_transactions
    SET serial_num = 'JCT20591'
    WHERE serial_num = 'jct20591';
    debug('No of rows in rcv_serial_transactions updated :'||sql%rowcount);
    UPDATE mtl_serial_numbers
    SET serial_number = 'JCT20591'
    WHERE serial_number = 'jct20591';
    debug('No of rows in mtl_serial_numbers updated :'||sql%rowcount);
    UPDATE mtl_unit_transactions
    SET serial_number = 'JCT20591'
    WHERE serial_number = 'jct20591';
    debug('No of rows in mtl_unit_transactions updated :'||sql%rowcount);
    UPDATE csi_item_instances_h
    SET new_serial_number = 'JCT20591'
    WHERE new_serial_number = 'jct20591';
    debug('No of rows in csi_item_instances_h updated :'||sql%rowcount);
    UPDATE csi_t_txn_line_details
    SET serial_number = 'JCT20591'
    WHERE serial_number = 'jct20591';
    debug('No of rows in csi_t_txn_line_details updated :'||sql%rowcount);
    UPDATE csi_item_instances
    SET serial_number = 'JCT20591'
    WHERE serial_number = 'jct20591';
    debug('No of rows in csi_item_instances updated :'||sql%rowcount);
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_return_err :='Updating in one of the script has this error:'|| substrb(sqlerrm, 1, 55);
    debug('Value of l_return_err='||l_return_err);
    END;
    Thanks
    Nagamohan

  • Another "How to call a stored procedure" question

    Hi,
    I want to call a stored procedure which returns 4 VARCHAR as a output
    parameter, and use 2 VARCHAR as a input parameter. How can I do
    that ?
    the signature of the SP is like this
    dec(
    in_a IN VARCHAR2,
    in_b IN VARCHAR2,
    out_c OUT VARCHAR2,
    out_d OUT VARCHAR2,
    out_e OUT VARCHAR2,
    out_f OUT VARCHAR2,
    Thank You

    There is an example in your wls installation, did you check that? it shows
    you how to access cursor as a resultset.
    <wls install dir>\samples\examples\jdbc\mssqlserver4\complexproc.java
    hth
    sree
    "Saman" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    I am using weblogic JDriver for MSSQLServer 7.0. I want to call a
    stored procedure which returns a CURSOR as a output parameter. How can Ido
    that ?
    the signature of the SP is like this
    Myprocedure (@c CURSOR VARYING OUTPUT)
    Thank You,
    Saman

  • How to call a stored procedure question

    Hi,
    I am using weblogic JDriver for MSSQLServer 7.0. I want to call a
    stored procedure which returns a CURSOR as a output parameter. How can I do
    that ?
    the signature of the SP is like this
    Myprocedure (@c CURSOR VARYING OUTPUT)
    Thank You,
    Saman

    There is an example in your wls installation, did you check that? it shows
    you how to access cursor as a resultset.
    <wls install dir>\samples\examples\jdbc\mssqlserver4\complexproc.java
    hth
    sree
    "Saman" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    I am using weblogic JDriver for MSSQLServer 7.0. I want to call a
    stored procedure which returns a CURSOR as a output parameter. How can Ido
    that ?
    the signature of the SP is like this
    Myprocedure (@c CURSOR VARYING OUTPUT)
    Thank You,
    Saman

  • How to call a stored procedure from my JSP?

    Hi to all,
              I have a very simple jsp page and a simple sql server stored procedure!
              I need to call this stored procedure by passing two parameters.
              My result set will have 4 columns.
              I would really appreciate any input on how to issue this call to a SP.
              I am new to JSP.
              Regards,
              Sam
              

              Sam,
              BEA provides examples that are shipped with the product under
              <beahome>\weblogic700\samples\server\src\examples\
              Look at the jsp directory for JSP examples that access a database and look at
              say the jdbc\oracle\storedprocs.java for an example of java code calling out to
              a stored procedure - - by combining one of the jsp database examples with this
              stored procedure example you should be 'good to go'
              Chuck Nelson
              DRE
              BEA Technical Support
              

  • How to call a stored procedure from WorkShop

    Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
    me .. Today I'm simply trying to find out how to call a stored procedure from
    within workshop, using any of the DB Controls .. I see workshop provides a way
    create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
    to be entered in place of the inline query .. Perhaps I've over looked it. Any
    advise on the best way to tackle this task will be appreciated.
    Atahualpa

    Atahualpa--
    Maybe this will help:
    http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
    Eddie
    Atahualpa wrote:
    Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
    me .. Today I'm simply trying to find out how to call a stored procedure from
    within workshop, using any of the DB Controls .. I see workshop provides a way
    create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
    to be entered in place of the inline query .. Perhaps I've over looked it. Any
    advise on the best way to tackle this task will be appreciated.
    Atahualpa

  • Calling a stored procedure which returns a value

    Hi Friends,
    I want to call a stored procedure which returns a value.
    Eg
    create or replace procedure xyz(a1 in varchar2, a2 in varchar2, z1 out number)
    thanks

    Hi,
    use this.
    declare
    retval number;
    begin
    abc('aaa','bbb',retval);
    dbms_output.put_line('retval is ' ||retval);
    end;
    --Basava.S                                                                                                                                                                                                                                                                                               

  • How to call a Store Procedure with IN PARAMETER

    Hi, im new using Oracle 10G with Oracle SQL Developer, my cuestion is how to call a Store Procedure with IN PARAMETER, I tried the following without results
    SELECT * FROM procedure_name(parameter);
    PROCEDURE procedure_name(parameter);
    EXEC procedure_name(parameter);
    CALL procedure_name(parameter);
    Please help me....

    Hi,
    As Beijing said,
    EXEC procedure_name(parameter);
    CALL procedure_name(parameter);work for me.
    So does
    BEGIN
        procedure_name(parameter);
    END;Can you be more specific about what you're doing? That is, are you testing it in SQL Developer? Where are you entering the commands? Where are you looking for output? Do you get error messages? Does anything else (like "SELECT SYSDATE FROM dual;") work?

Maybe you are looking for