Response message from stored procedure

I have created  the stored procedure(oracle)
CREATE OR REPLACE PROCEDURE UPDATE_INSERT(sHID IN VARCHAR2,sZNAME IN VARCHAR2,sZDATE IN DATE)IS
I NUMBER;
BEGIN
SELECT COUNT(HID) INTO I FROM ZSO_H WHERE HID = sHID;
IF I > 0
THEN
begin
DELETE FROM ZSO_H WHERE HID = sHID;
end;
END IF;
INSERT INTO zso_h VALUES(sHID,sZNAME,sZDATE);
commit;
END UPDATE_INSERT;
It's proxy to jdbc synchronous scenario.
I can see data saved in the table, and sucessfull in communication channel monitoring.
but sxmn_moni, get error,(SAP system)
<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException</SAP:AdditionalText>
  <SAP:ApplicationFaultMessage namespace="" />
  <SAP:Stack />
  <SAP:Retry>M</SAP:Retry>
sxmb_moni in XI
  <?xml version="1.0" encoding="utf-8" ?>
- <ns0:t002_ora_response xmlns:ns0="http://topfine.com/proxy">
  <st3_response />
  <st3_response />
  <st3_response />
  <st3_response />
  <st3_response />
  </ns0:t002_ora_response>
but structure is
   <st3_response>
      <insert_count/>
      <update_count/>
   </st3_response>
and the db request message is
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:t002_ora xmlns:ns0="http://topfine.com/proxy">
- <st3>
- <spName action="execute">
  <table>UPDATE_INSERT</table>
  <SHID type="VARCHAR">21</SHID>
  <SZNAME type="VARCHAR">21</SZNAME>
  <SZDATE type="DATE">2010-11-21</SZDATE>
  </spName>
  </st3>
- <st3>
- <spName action="execute">
  <table>UPDATE_INSERT</table>
  <SHID type="VARCHAR">22</SHID>
  <SZNAME type="VARCHAR">22</SZNAME>
  <SZDATE type="DATE">2010-11-21</SZDATE>
  </spName>
  </st3>
then how to get update_count in  response message?
Edited by: Shen Peng on Nov 21, 2010 8:35 AM

Can you jus let know totally how many are getting Updated and inserted for the Proxy u sent....I am guessin the response from ur DB is
<?xml version="1.0" encoding="utf-8" ?>
- <ns0:t002_ora_response xmlns:ns0="http://topfine.com/proxy">
<st3_response />
<st3_response />
<st3_response />
<st3_response />
<st3_response />
</ns0:t002_ora_response>
So probably four records are getting updated or inserted...
Check this blog may be helpful
/people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response

Similar Messages

  • Capture error messages from stored procedure calls

    Hi there,
    How do I capture a stored procedure calls error messages provided the stored procedures does not have output parameters? This questions applies to Oracle 7.3.4 stored procedures calls.
    TQ
    Neo

    There are two parts.
    The stored proc must 'throw' an exception.
    And java must catch it.
    You probably already have the java part. That is the catch(SQLException).
    As for the stored proc you can use the following search string in the jdbc forum
    raise oracle
    You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it.

  • Display error messages from Stored Procedures through ODBC

    I am working on a C++ application that uses an Oracle ODBC connection. In the exception part of a stored procedure I am using dbms_output.put_line ('error message'). Is there any way to display this message in the C++ application?
    Thanks.

    There are two parts.
    The stored proc must 'throw' an exception.
    And java must catch it.
    You probably already have the java part. That is the catch(SQLException).
    As for the stored proc you can use the following search string in the jdbc forum
    raise oracle
    You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it.

  • Paging a message from stored procedure

    How can we write a code in pl/sql to send a pager message to a specified pager ?
    Atul

    If you can send an email to pager then you may use utl_smtp package
    otherwise you have to clarify how technically you can send a message to pager
    Maybe you need some hardware costing 1M $ ;)

  • Invoking BPEL with large request payload from stored procedure

    Hi all,
    I have a stored procedure which invoke BPEL process. It is working fine with small payload (around 3000 characters). But some of the payload are as large as 75 to 100 thousand characters. I used the clob datatype for my soap envelop variable so that it can take more characters. But I am getting error if the payload size is large. Can someone help me figure how I am able to do this. Thanks.

    Hi James,
    Thanks for your response. What I need to do is, if any of the instance is failed in the first invokation, user can manual re-invoke the same process from the dashboard. I tried invoking bpel from ADF 11g and finally found out that it is not supported with SOA 10.1.3.4. (I can't use Data control as the payload is already in the database).
    I am invoking an Asynchronous process. So, it is not the timeout error. The same procedure went fine with the same process if the payload is small. I include one output parameter to send the message from the procedure back to ADF, and what Ifound out was if the payload is big, I got the exception right after "utl_http.write_text(l_http_request, l_soap_envelope);". Any hope that I can still use this without going to ODI?
    Thanks.
    SHY

  • Problem with execute SSIS package from stored procedure

    Hi,
    I would like to execute SSIS package from stored procedure. Therefore, I implemented sp which exec SSISDB.CATALOG.CREATE_EXECUTION method. When I try to test it from SSMS on remote server, I got error that
    I was able to solve by adding “WITH EXECUTE AS …”. Then I got another error: The server principal "Domain\user" is not able to access the database "SSISDB" under the current security context. On Internet, I found a couple post that describe
    how to access SSIS catalog (one of them by Ke Yang -
    http://blogs.msdn.com/b/mattm/archive/2012/03/20/ssis-catalog-access-control-tips.aspx). It didn’t help. I’m still getting the error message.
    How to debug this issue?
    Any suggestion?
    Thanks
    SQL Server 2014 BI

    SSMS does not propagate user credentials thus the error
    Arthur
    MyBlog
    Twitter

  • Ora-06550 returning data from Stored Procedure and Entity Data Model

    Hi.
    I'm creating an application that uses a WCF Service to return data. I also created a proyect with the EDMX design and mapped most of my DBModel to a classes context. I have added some of the procedures as well. One of them receive some parameters and return a Sys_RefCursor, that is populated according to the parameters.
    I have declared the "<add >" tags in the Web.Config and imported the function of the Procedure. When I call the Asyncronous function I get different exceptions:
    1. If I call the function, with all of the parameters i get:
    Oracle.DataAccess.Client.OracleException: ORA-06550: línea 1, columna 8:
    PLS-00306: número o tipos de argumentos erróneos al llamar a
    'SP_HECHOSJURITER'
    ORA-06550: línea 1, columna 8:
    (wrong number or types of arguments in call to 'SP_HECHOSJURITER')
    2. If i just set 1 parameter in the SP, returning the same type of data, I get:
    Error al recibir la respuesta HTTP a
    http://localhost/Procalculo.CGFM.SIGOC.DatosServices/ServiceDatos.svc.
    (failed to receive http response. error 12152)
    3. If I don't set any parameters in the procedure, it works fine, and return correct data.
    It exclusively happen with one entity.
    Any clue?
    I appreciate any help.

    When you return result sets from stored procedures to Entity Framework, you are very likely using implicit result sets. Implicit result sets don't need to be declared as a parameter in code, only in the <add> tags to define the metadata in the .NET config file.
    For example, in the EF Oracle By Example, you'll see that the stored procedure in the function import has three parameters, but only two are declared in the code. The third one was defined in the config file.
    http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm

  • Returning SQL cursor from Stored Procedure

    Hi,
    I have a query regarding returning sql cursor from stored procedure to java in oracle 11g.
    I want to query some data ex: my query returns A, B, C. Also, now I want to query some other data ex: D, E, F. Now I want to return this data as an sql cursor as a single row . Example: A,B,C,D,E,F. Is it possible to return/create a cursor in stored procedure?
    assume both query returns equal number of rows.. however both are not related to each other..

    RP wrote:
    Hi,
    I have a query regarding returning sql cursor from stored procedure to java in oracle 11g.
    I want to query some data ex: my query returns A, B, C. Also, now I want to query some other data ex: D, E, F. Now I want to return this data as an sql cursor as a single row . Example: A,B,C,D,E,F. Is it possible to return/create a cursor in stored procedure?
    assume both query returns equal number of rows.. however both are not related to each other..It sounds like what you need is a ref cursor.
    First thing to remember though is that cursors do not hold any data (see: {thread:id=886365})
    In it's simplest form you would be creating a procedure along these lines...
    SQL> create or replace procedure get_data(p_sql in varchar2, p_rc out sys_refcursor) is
      2  begin
      3    open p_rc for p_sql;
      4  end;
      5  /
    Procedure created.
    SQL> var rc refcursor;
    SQL> exec get_data('select empno, ename, deptno from emp', :rc);
    PL/SQL procedure successfully completed.
    SQL> print rc;
         EMPNO ENAME          DEPTNO
          7369 SMITH              20
          7499 ALLEN              30
          7521 WARD               30
          7566 JONES              20
          7654 MARTIN             30
          7698 BLAKE              30
          7782 CLARK              10
          7788 SCOTT              20
          7839 KING               10
          7844 TURNER             30
          7876 ADAMS              20
          7900 JAMES              30
          7902 FORD               20
          7934 MILLER             10
    14 rows selected.
    SQL> exec get_data('select deptno, dname from dept', :rc);
    PL/SQL procedure successfully completed.
    SQL> print rc
        DEPTNO DNAME
            10 ACCOUNTING
            20 RESEARCH
            30 SALES
            40 OPERATIONS
            50 IT SUPPORTWhich takes an SQL statement (as you said that both your queries were unrelated), and returns a ref cursor, and then your Java code would fetch the data using that cursor.
    Now, as for getting your rows to columns and combining two queries that do that... something along these lines...
    SQL> select * from x;
    C
    A
    B
    C
    SQL> select * from y;
    C
    D
    E
    F
    SQL> ed
    Wrote file afiedt.buf
      1  select x.col1, x.col2, x.col3
      2        ,y.col1 as col4
      3        ,y.col2 as col5
      4        ,y.col3 as col6
      5  from (
      6        select max(decode(rn,1,col1)) as col1
      7              ,max(decode(rn,2,col1)) as col2
      8              ,max(decode(rn,3,col1)) as col3
      9        from (select col1, rownum rn from (select * from x order by col1))
    10       ) x
    11  cross join
    12       (
    13        select max(decode(rn,1,col1)) as col1
    14              ,max(decode(rn,2,col1)) as col2
    15              ,max(decode(rn,3,col1)) as col3
    16        from (select col1, rownum rn from (select * from y order by col1))
    17*      ) y
    SQL> /
    C C C C C C
    A B C D E F... will do what you ask. For further information about turning rows to columns read the FAQ: {message:id=9360005}

  • Executing SQLPLUS command from Stored Procedure

    Hi,
    I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.
    It is throwing below error message.
    Stored Procedure:
    SQL> select user from dual
    2 ;
    USER
    SYS
    SQL> create or replace
    2 PROCEDURE PROCEDURE1 AS
    3 BEGIN
    4 sqlplus sys/sys@D as sysdba;
    5 --execute immediate 'create user 'kkk' identified by 'kkk';
    6 END PROCEDURE1;
    7 /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE PROCEDURE1:
    LINE/COL ERROR
    3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
    following:
    := . ( @ % ;
    The symbol ":=" was substituted for "SYS" to continue.
    3/22 PLS-00103: Encountered the symbol "AS" when expecting one of the
    following:
    . ( * @ & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol ". was inserted before "AS" to continue.
    Please let me know whether it is possible to do or not.
    If there is possiblility how can does this be done?
    Edited by: NGK246 on Aug 28, 2012 2:21 AM

    NGK246 wrote:
    Hi,
    I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.
    It is throwing below error message.
    It would not. It will always throw an error. SQLPLUS is a Utility and not a Command/Construct, that it would be available for a Stored Procedure
    >
    SQL> select user from dual
    2 ;
    USER
    SYSWhich Database are you onto? Is it DMIP?
    SQL> create or replace
    2 PROCEDURE PROCEDURE1 AS
    3 BEGIN
    4 sqlplus sys/sys@DMIP as sysdba;
    5 --execute immediate 'create user 'kkk' identified by 'kkk';
    6 END PROCEDURE1;
    7 /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE PROCEDURE1:
    LINE/COL ERROR
    3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
    following:
    := . ( @ % ;
    The symbol ":=" was substituted for "SYS" to continue.
    3/22 PLS-00103: Encountered the symbol "AS" when expecting one of the
    following:
    . ( * @ & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol ". was inserted before "AS" to continue.
    Please let me know whether it is possible to do or not.
    If there is possiblility how can does this be done?If you are at DMIP, you need not Login again. You can Login Manually to the Database and Execute the Procedure (in which you intend to create a User 'kkk').
    However, if you are trying to Create a User in a Different Database, You will first require a DB Link to exist to connect to the Remote Database. You will also require Explicit privileges to create any user (Although I am not sure if you can create User onto a different Database.)
    I would like to ask you, why are you creating a User on a Remote database? Can you not execute the same procedure on the Remote database and create User? Also, you are using SYS login to perform the activity. Ideally it should not be allowed. You must create a user and grant DBA rights to perform such activities.

  • How to generate a report from stored procedure

    I would like to generate a report from stored procedure.
    I used to work on sql server. this can be done as easy as put a select statement at the end of stored procedure.
    The resule can be displayed on the development IDE, like sql developer or consume by Java JDBC client.
    is there equivalent way to do this in Oracle stored procedure?

    Hi,
    What type of report you are looking..for.. ??
    As you said that "I used to work on sql server. this can be done as easy as put a select statement at the end of stored procedure. "
    When you execute it will return the result set and you will display directly on the FrontEnd.. Is my Understanding is correct Up to here.
    See, In oracle you have call some custom stored procedures as you did in SQL Sever, but you have return the Results Sets, with help of Out put paramter, Either Cursors or Varrays..
    or Else you can generate the Html reports based on your requirement, HTML can be used in the stored procedures of Oracle which will generate for your, you need to code it.
    I could not able get the relevant link for your reference.
    I will get back to you on this.
    - Pavan Kumar N

  • Calling DTS package from Stored Procedure

    I am getting error calling DTS package from CF.
    So i want to call DTS package from SQL Server Stored
    Procedure.
    DTS package create text file. So no need of input or output
    parameter.
    What is the syntax?.
    thanks for ur help.

    Ted Kruger explains how this can be done in his blog post
    Run SSIS Package from Stored Procedure
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog

  • Best method to transfer large strings (XML data) to/from stored procedure

    Hi!
    I'm trying to call a PL/SQL procedure from Java. The procedure inputs a string (XML) that is parsed, and returns a result string (also XML).
    Typical size of the string is 5kb -> 1mb.
    I can see two possible solutions:
    1) String / LONG
    2) CLOB (Using DMBS_LOB.createTemporary and getting a CLOB locator and passing the locator to the stored procedure)
    Does anyone have other suggestions?
    What is the fastest method for transferring XML structures from to and from stored procedures?
    Anders

    Anders,
    I would say it depends on your requirement. Both the methods have some advantages and disadvantages.
    Using a CLOB means that you have to use vendor specific libraries but this is more extendible and I fast too.
    Using String/Long will be more portable in the long run but again you lose on speed/performance.
    Just a doubt of mine... If I got it correct, you are transforming one XML to another XML based on some conditions. Why dont you use XSL and XSL StyleSheet Processor packaged with XDK for this? I think this would be the fastest way.
    Hope this helps.

  • System command execution from stored procedure

    Hello World,
    How to run System command from stored procedure ?
    For example :
    Delete a file
    running a programm,
    Is it possible ?
    H.M

    Years ago I did this by writing an output file with commands into a directory and had a cron job looking for this file. At the end of the run the file was removed.
    Never checked if there are other possibilities nowadays.
    cu
    Andreas

  • Issue with Executing OS commands from Stored Procedure

    I am trying to execute the scripts provided at :
    http://github.com/xtender/XT_SHELL
    provided by xtender user.
    As required, I have asked my DBAs to grant privileges by executing the following scripts:
    Begin
      --change to needed permissions and execute
      dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/factiva/ODS/bin/CVIM_Rpt_ExportCSVFile’, 'read,write,execute' );
    end;
    /where CVIM_Rpt_ExportCSVFile is my script residing in the Unix server where my Oracle is installed.
    The error I am facing when I try to execute the following command is:
    select * from table(xt_shell.shell_exec('/var/scripts/CVIM_Rpt_ExportCSVFile',100))
    Exception:the Permission (java.io.FilePermission /var/scripts/CVIM_Rpt_ExportCSVFile execute) has not been granted to ODS. The PL/SQL to grant this is dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )I have asked my DBA to also execute the following scripts: - But I still see the same error as above. I am not able to figure out whats going on. Can anyone pls help me out??
    EXEC Dbms_Java.Grant_Permission('ODS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission(ODS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )

    DUPLICATE
    ===============================================================
    Issue with Executing OS commands from Stored Procedure
    ==============================================================

  • Returning rowcount and resultset from stored procedure

    Hello,
    In SQL Server you can return multiple resultsets from stored procedure by simple SELECT statement. But in Oracle, you have to use SYS_REFCURSOR.
    Sample code:
    CREATE OR REPLACE PROCEDURE sp_resultset_test IS
    t_recordset OUT SYS_REFCURSOR
    BEGIN
    OPEN t_recordset FOR
    SELECT * FROM EMPLOYEE;
    END sp_resultset_test;
    Is there any other way in Oracle 10 or 11 ?
    Thank You.

    What is the requirement? Oracle is far more flexible than SQL-Server... with numerous features that do not exist in SQL-Server. (Fact)
    One of the biggest mistakes you can make is to treat Oracle like SQL-Server... trying to match feature A1 in SQL-Server to feature B3 in Oracle.
    Does not work that way.. rather then stick to SQL-Server as SQL-Server does SQL-Server specific features far better than Oracle.
    So instead of trying to map what a T-SQL stored proc to do to an Oracle ref cursor (even to the extent of using that very silly sp_ prefix to name the proc), tell us the problem and requirements... That way we can tell you what Oracle features and options are best used to solve that problem - instead of competing in some unknown feature comparison event with SQL-Server.

Maybe you are looking for

  • How to use global parameters in Opertional Mapping??

    Hi, I have to create 4 mappings. 1. File to PI(Graphical): To extract Payload form incoming hedaer,payload & trailer & few validation which gives an ERROR variable. 2. XSLT: payload to IDOC stucture data type. 3. To IDoc(Graphical): final mapping to

  • Macbook Aluminum to VGA Output

    I have a Macbook Aluminum and I am trying to output that to my TV. I have bought the miniPort to VGA adapter and hooked it up to my LCD TV with a VGA input. When this happens, I am only able to see my desktop background and nothing else. It will not

  • Document links repositioned after OCR is performed. Is there a workaround or solution?

    We use Adobe Acrobat Pro 10. We receive files that have imbedded links which link various parts of the PDF file to each other. It is necessary to complete OCR on this file for future search purposes. However, we have found that performing OCR causes

  • Report 6i

    I need help from someone with a problem I have with the report that leaves only generate information, but when you invoke from the button nothing comes not only the logo that has the report.

  • Cisco 5760 WLC initial config

    Hi, I am configuring up a Cisco 5760 WLC and wondering if it is required to put in a default route? In this document it says to put one in but i dont see why it is needed as it is connected to a switch via a layer 2 Trunk. Reference: https://supportf