"table type" result from stored procedure (Oracle 10g) for physical service

Hello,
I'm trying to create a physical service based on a stored procedure which returns a table type like this:
SQL
-- create table
create table myTable ( "col1" VARCHAR2(250) not null enable, "filtercol1" VARCHAR2(250), "filtercol2" VARCHAR2(250), "sortcol1" VARCHAR2(250), "sortcol2" VARCHAR2(250), "sortcol3" VARCHAR2(250))
-- create return type
create or replace type myResultType as table of varchar2(250);
-- create function
create or replace function getResult(param1 in varchar2, param2 in varchar2, orderby in varchar2) return myResultType as
query_str VARCHAR2(1000);
myResult myResultType;
begin
query_str := 'select m.col1 from myTable m where m.filtercol1 like :param1 and m.filtercol2 like :param2 order by ' || orderby;
execute immediate query_str bulk collect into myResult using param1, param2;
return myResult;
end getResult;
The wizard for creating the physical service complains that it can't find the return type and I have to create a schema by myself. How should it look like? I can't find a sample in the documentation.
Thanks for any help,
Guido

Ok, now the wizard produces something like this:
(::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="protected" kind="library" isPrimary="false" nativeName="GETRESULT" nativeLevel2Container="MY_SCHEMA" style="storedProcedure">
<nonCacheable/>
<params xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" xmlns:pn1="ld:physical/SQLServices/MY_TMP_TABLE" >
<param name="RETURN_VALUE" kind="return" xqueryType="pn1:MY_TMP_TABLE" nativeTypeCode="0" nativeType="RowSet"/>
<param name="RETURN_VALUE" kind="out" xqueryType="pn1:MY_TMP_TABLE" nativeTypeCode="0" nativeType="RowSet"/>
<param name="PARAM1" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
<param name="PARAM2" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
<param name="ORDERBY" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
</params>
</f:function>::)
declare procedure f1:GETRESULT($PARAM1 as xs:string, $PARAM2 as xs:string, $ORDERBY as xs:string) as schema-element(t1:GETRESULT) external;
Then WorkSpace Studio complains about: "... error: cos-element-consistent: Type of 'RETURN_VALUE' is inconsistent with another element with the same name in this content model. "
If I rename one RETURN_VALUE to RETURN_VALUE1 (the param name and in the schema file) the error is gone, but if I try to test the method I get:
com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQuerySagaException: {bea-err}UPD003: Update failure: mixed outcome, update error dispatched (updateid=SAGA_596ba32b1ff8d8a4:181f0b20:11f92ed2529:-7fe2): java.lang.RuntimeException: Konflikt bei Parametertyp
     at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
     at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
     at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
     at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:121)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1006)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1134)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1807)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:159)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1535)
     at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1538)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1500)
     at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
     at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
     at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
     at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
     at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
     at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
     at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
     at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
     at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
     at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
     at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at org.eclipse.core.launcher.Main.invokeFramework(Main.java:339)
     at org.eclipse.core.launcher.Main.basicRun(Main.java:283)
     at org.eclipse.core.launcher.Main.run(Main.java:984)
     at org.eclipse.core.launcher.Main.eclipse_main(Main.java:959)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:39)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
"Konflikt bei Parametertyp" means something like: parameter type conflict
Best regards,
Guido

Similar Messages

  • Populate report page based on results from stored procedure

    Is it possible to populate a report page in APEX based on the results from a stored procedure? If so, how do I do it? Do I write a stored procedure with a ref cursor as out parameter?

    I would use a stored procedure to return the values for a form but not for a report. For a
    report, I would use a pipelined function. See an example here:
    http://htmldb.oracle.com/pls/otn/f?p=31517:146
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Retrieving PL/SQL Table Type returned by stored procedure using Java.

    Hi All,
    I am facing an issue in a Stored Procedure (SP) which returns Table Type, the PL/SQL complex type.
    Below mentioned is how my stored procedure looks like.
    CREATE OR REPLACE package sp_test_pkg as
    TYPE v_value_table_type is table of SW_VALID_CODE.swValue%Type
    index by binary_integer;
    v_swRMAStatus v_value_table_type;
    procedure sp_test
    (locale      in int,
              name      in SW_CODE.swName%Type,
              v_value_table out v_value_table_type,
    batch_size in int,
    out_batch_size in out int,
    status out int);
    end sp_test_lcode_code_pkg;
    My java program to access this stored procedure is as given below:
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class OracleTest {       
         public static void main(String args[]) {
         Connection con = null;
    OracleCallableStatement cstmt = null;
    String url = "url";
         String userName = "username";     
         String password = "password";
    try
              DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());     
              con = DriverManager.getConnection(url, userName, password);
         cstmt = (OracleCallableStatement)con.prepareCall("begin " +
              "sp_test_pkg.sp_test_pkg(?,?,?,?,?,?); end;");
              cstmt.setInt(1, 1);
         cstmt.setString(2, "Test");
              cstmt.registerOutParameter(3, OracleTypes.ARRAY);
              cstmt.setInt(4, 10);
              cstmt.setInt(5, 1);
              cstmt.registerOutParameter(5, Types.INTEGER);
              cstmt.registerOutParameter(6, Types.INTEGER);
              cstmt.execute();
    } catch(Exception ex) {
    ex.printStackTrace(System.err);
    } finally {
    if(cstmt != null) try{cstmt.close();}catch(Exception _ex){}
    if(con != null) try{con.close();}catch(Exception _ex){}
    When i execute this java program, i get the following error:
    java.sql.SQLException: Parameter Type Conflict: sqlType=2003
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterBytes(OracleCallableStatement.java:245)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:389)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:452)
         at OracleTest.main(OracleTest.java:49)
    I am not sure where i am going wrong. I have never worked on such complex types before. I want to retrieve the complex table type returned by the stored procedure using my java source code.
    Can anyone please help me out in resolving this issue?. This is very urgent.

    JDBC does not recognise types declared in PL/SQL. This is documented in the Dev Guide. [Find out more|http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oraarr.htm#1057625].
    The only work around would be to build a wrapper which calls your existing PL/SQL procedures and returns a SQL type instead. Obviously not knowing your precise scenario I have no idea how much work this entails for you. It may be worth building a code generator.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Manage several results from stored procedures

    Hi,
    I'm calling a stored procedure which in turn calls six other stored procedures and I'm getting six results in return. But the following code only ends up in one result in the resultset (the first one):
    // Define stored procedure
    String sp = "EXEC GET_XXX";
    CallableStatement cs = null;
    ResultSet rs = null;
    // Connect to database
    Connection con = getConnection();
    // Prepare statement          
    cs = con.prepareCall(sp);
    // Excecute Sql query
    rs = cs.executeQuery();How can I manage several results?

    Not much help, but I couldn't tell you how to do this using PDO. If however, you want to know how to do it without PDO (i.e. via OCI8 PHP functions directly), let me know and I will post some code...

  • Call WS from stored procedure (Oracle)

    Hi All
    I have scenario: JDBC - XI - RFC. It works fine.
    Now I want to change it to SOAP - XI - RFC.
    I can take wsdl url in Sender Agreement.
    I can test it from Web Services Navigator - it is ok.
    Can I send message from Oracle using soap_api? Give me a sample plz
    Regards,
    Andrey.

    you need a custom application which can read DB and send the data to XI through exposed webservice.
    The custom application can be implemented in any language such as JAVA, C/C++, NET etc..........

  • 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

  • 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

  • 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

  • Datetime parameter from stored procedure

    <p>I have a report written in CR10 which uses a stored procedure as the datasource. The stored procedure has 3 input parameters, two of which are datetime data types. When the crystal report is run, it prompts the user for the 3 parameters & runs just fine except...</p><p>For the date parameters, it prompts the user to enter a time as well. In previous versions of Crystal, parameters that were datetime data types in the stored procedure were just prompted for the date when the calling crystal report was run.</p><p>I attempted to edit the parameters in the report, but the "Value Type" is grayed out (I assume since the parameter is associated with the stored procedure, rather than being a user defined parameter within the report).  These date parameters are used in a BETWEEN statement in the stored proc, so if the user just enters a date but accepts the default time, the returned data gets flakey due to the addition of the time value passed by the parameter.</p><p> I tried setting a default value for the time, but I have to enter a date along with the time, which the report then uses as the default. The user then has to uncheck the "Pick from defaults" checkbox in order to enter their own date. This is really unwieldly for the end user, especially when they were previously able to just enter a date and not have to be concerned with a time at all.</p><p>Does anyone have suggestions on working around this issue? </p><p>Thanks in advance...</p>

    <p>You mention that you are using CRW version 10 for this.  What&#39;s the data source you are reporting against (you mention a stored procedure - but are you running against Oracle, SQL Server, DB2?).  Are you connecting natively or using ODBC? <br /></p>

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

  • Query to get list of linked server tables referenced inside a stored procedure

    Hi,
    SQL Server 2005 sp4
    I have a requirement to get list of linked server tables referenced insider a stored procedure
    Ex:
    Databases       DB1          DB2
    Tables:            T1             T2                            
    Use DB1
    Go
    Create proc P1
    begin
    select * from T1
    select * from DB2.dbo.T2
    end
    I am looking for a query which can return a result with output as below. sp_depends is not helping here as it does not work for cross DB objects, any other thoughts.
    Tables
    T1,
    DB2.dbo.T2

    On SQL 2005, you will have to do it manually.
    On SQL 2008 or later, you could have used sys.sql_expression_dependencies.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • URGENT : Return Bulk data from Stored Procedure

    Hi,
    Tell me, how do I return a bulk of data which
    does not exist in the data base
    but is concluded while the Stored Procedure is executed
    from the Stored procedure
    to the C++ program.
    For Example:
    Table ABC
    Field1 Field2 Field3
    A 1 3
    B 1 5
    C 2 10
    Table DEF
    Field1 Field2 Field3
    D 10 24
    E 3 16
    F 8 19
    SP_TESTING
    Depending on the values in both the tables
    for some range of conditions,
    a conclusion X is derived for each range value of the
    condition range.
    Now I need to return this bulk of data X with the
    condition they belong to
    back to the C++ code calling it....
    NOTE : A stored procedure is requited as there is a lot
    of processing
    required before we conclude the result X for each value
    in the condition range.
    If I execute this code from C++ instead of Stored
    procedure
    it is very slow and speed is a prime requirement of my
    system.
    Also i'm not using any MFC class to access database.
    I'm using ConnectionPtr, RecordsetPtr and _CommandPtr
    from msado15.dll for database access...
    One solution to this could be use of Temp tables.
    As this process is used by a lot of different stored
    procedures having a common
    temp table to all will need something like 50 NUMERIC
    fields, 50 VARCHAR fields
    and so on, which doesn't seem like a very good solution
    to this problem.
    Sounds like something I would have done while in school,
    implement a dumb solution.
    So, please suggest me a solution as to how do I return
    bulk data in the form
    of recordsets from stored procedure.
    Regards
    Shruti

    Use Out parameter mode
    SQL> CREATE OR REPLACE procedure a1 (x  OUT NUMBER, y  OUT NUMBER) AS
      2  BEGIN
      3        x:= 1;
      4        y:= 2;
      5  END;
      6  .
    SQL> /
    Procedure created.
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
      2   a NUMBER :=3;
      3   b NUMBER :=4;
      4  BEGIN
      5   a1 (a,b);
      6      DBMS_OUTPUT.PUT_LINE( 'a = ' || a );
      7      dbms_output.put_line( 'b = ' || b );
      8  END;
      9  .
    SQL> /
    a = 1
    b = 2
    PL/SQL procedure successfully completed.By default parameters are copied to the OUT parameter mode .
    COPY hint in PLSQL don’t send a pointer to calling program unit but NOCOPY
    does.
    Khurram

  • Web Service receives no data from Stored Procedure call.

    Issue: When calling a Stored Procedure from a Web Service no data is returned.
    Lead up: I can call the SP 100 times a day for 3-4 days then for some reason the Web Service no longer get the data from SQL. I have ran a trace and I can see the SP running though all of its steps and returning the data, but the Web Service
    is not getting it.
    Fix: None yet.
    Work around: Before the Web Service calls the SP, I am sending an SP_Recompile to the SP in question. For now this seems to have resolved the issue.
    Detail: 
    1. SP is querying data from another DB on the same server.
    2. SP is storing query data in Temp Tables.

    Hello,
    Does your Stored Procedure have parameters? If so, the issue may be cause by parameter sniffing. Please refer to the following blog about Paraemeter Sniffing:
    http://www.sommarskog.se/query-plan-mysteries.html
    The recommended fix for most situations is to not use parameters directly in queries, but rather store them into local variables and then use those variables in the queries.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • How to find the columns and tables used in a stored procedure?

    Hi,
    Can someone suggest how to find the columns and tables used within a stored procedure?
    Thanks
    VBK

    For example:
    SQL> create or replace
      2    procedure p1
      3      is
      4          cnt number;
      5      begin
      6          select count(*) into cnt from emp;
      7  end;
      8  /
    Procedure created.
    SQL> select  referenced_owner,
      2          referenced_name
      3    from  dba_dependencies
      4    where owner = 'SCOTT'
      5      and name = 'P1'
      6      and referenced_type = 'TABLE'
      7  /
    REFERENCED_OWNER               REFERENCED_NAME
    SCOTT                          EMP
    SQL> SY.

  • Find all tables used in a stored procedure

    Hi,
    I have a requirement where i have to find all the tables used in a stored procedures from different  databases.
    Ex: i have a stored procedure where i use few tables from MASTER database and some from STAGE database.When i have written a query to find all tables used in the stored procedure, i am getting only those database table where i run the query and procedure
    exists.
    I have stored procedure SP1 in Master database, but i use the tables from both master and stage.
    When i run this, i am getting the tables only from Master database but not from stage. i hope my requirement is clear.
    I am trying to find all the tables from all databases used by a stored proc.
    ;WITH stored_procedures AS (
    SELECT 
    o.name AS proc_name, oo.name AS table_name,
    ROW_NUMBER() OVER(partition by o.name,oo.name ORDER BY o.name,oo.name) AS row
    FROM sysdepends d 
    INNER JOIN sysobjects o ON o.id=d.id
    INNER JOIN sysobjects oo ON oo.id=d.depid
    WHERE o.xtype = 'P')
    SELECT proc_name, table_name FROM stored_procedures
    WHERE row = 1
    ORDER BY proc_name
    Please advice

    Your question is not entirely clear. You need to run the query on different databases.
    You may find this blog post helpful
    How to get information about all databases without a loop
    Check the last script in that blog post and modify to your particular purpose.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

Maybe you are looking for

  • Changing the Assignment of production order in sales order in MTO scenario.

    Hello all! I have following problem: After the MRP a production order was created for a sales order. Because of the production in another plant the production order which was created automatically had to be technically completed and a new one created

  • Berkeley DB Java Edition 3.3.69 is available

    Berkeley DB Java Edition (JE) 3.3.69 is now available for download. The release contains a number of bug fixes, some to problems posted on the OTN forum. The full list of changes may be found in the change log. <br> <br> There is one critical bug fix

  • How do i update as itunes wont work at all

    it keeps coming up   Problem Event Name: BEX   Application Name: iTunes.exe   Application Version: 11.3.1.2   Application Timestamp: 53dc1f90   Fault Module Name: StackHash_0a9e   Fault Module Version: 0.0.0.0   Fault Module Timestamp: 00000000   Exc

  • JDBC Adapter. Help required

    Hi All, Can JDBC Adapter be used for calling API for stored procedures of database. If yes please send blogs/docs for it. Regards

  • Font looks much differnt on PC

    I recently made a website on iWeb and used the courier font size 72. Everywhere this font was used in this size looks completely distorted and pixelated on any PC that opens my site. Does anyone know why? The site can be found at http://web.mac.com/a